Skip to content

Instantly share code, notes, and snippets.

@tommedema
Created April 12, 2011 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tommedema/915955 to your computer and use it in GitHub Desktop.
Save tommedema/915955 to your computer and use it in GitHub Desktop.
//main.js
var util = require('util');
util.debug('main initializing');
var someMod = require('./someModule')('SomeApp', 'Tom');
someMod.displayAppName();
someMod.displayUserName();
//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