Skip to content

Instantly share code, notes, and snippets.

@allthetime
Created October 20, 2015 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save allthetime/d5cada9625f52b8f7c26 to your computer and use it in GitHub Desktop.
Save allthetime/d5cada9625f52b8f7c26 to your computer and use it in GitHub Desktop.
// main file
var some_module = require('some_module');
var mod1 = require('./module1.js')(some_module);
var mod2 = require('./module2.js')(some_module);
// module1.js
var mod1 = function(some_module) {
return {
// methods that use some_module
}
}
module.exports = mod1
// module2.js
var mod2 = function(some_module) {
return {
// methods that use some_module
}
}
module.exports = mod2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment