Created
October 20, 2015 21:14
-
-
Save allthetime/d5cada9625f52b8f7c26 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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