Created
April 12, 2011 17:18
-
-
Save tommedema/915955 to your computer and use it in GitHub Desktop.
This file contains hidden or 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.js | |
var util = require('util'); | |
util.debug('main initializing'); | |
var someMod = require('./someModule')('SomeApp', 'Tom'); | |
someMod.displayAppName(); | |
someMod.displayUserName(); |
This file contains hidden or 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
//someModule.js | |
module.exports = function(appName, userName) { return new function() { | |
var util = require('util'); | |
this.displayAppName = function() { | |
util.debug('app name: ' + appName); | |
} | |
this.displayUserName = function() { | |
util.debug('user name: ' + userName); | |
} | |
} } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment