Message from JavaScript discussions

November 2020

— Let me check that out


Not only do you avoid recursive dependencies, but you also open up to a lot of other flexibility goodies.. Like testing (mockability), you can wrap dependencies to your liking to add more functionality (e.g. a logger attached to fs.writeFile calls) there are many possibilities. It might look like a bit too much code, but you will soon appreciate the flexibility.

— It works like that:

// index.js
const dependencies = {
a: require('./a'),
b: require('./b'),

// a.js
module.exports = dependencies => ({
getFile: () => 'filename',
save: () => {


// b.js
module.exports = dependencies => ({
whatever: () => dependencies

Message permanent page

— This is better viewed here:

— Thanks for the help. I will try implementing it and see how it goes

— Don't hesitate to ask, if you have any questions :)

— This is so wonky

— We need website developer or freelancer.
Send msg,

— Senior html developer?

— I can nest interactive elements even without a shame ❤️

— "If I am grown up, I want to be a Senior HTML developer" lel! :D

— Xd