Last active
August 29, 2015 14:15
-
-
Save joepie91/9b1ca2392a72e82b44fb to your computer and use it in GitHub Desktop.
Configurable exports in Node.js
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
module.exports = function(configuration) { | |
var configuredInstance = createInstance(configuration); | |
return function(argOne, argTwo) { | |
configuredInstance.doThing(argOne) | |
return configuredInstance.doAnotherThing(argTwo); | |
} | |
} |
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
var someModule = require("./some-module")(configuration); | |
someModule(argOne, argTwo); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment