Skip to content

Instantly share code, notes, and snippets.

@Raynos
Forked from tommedema/main.js
Created April 12, 2011 17:12
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 Raynos/915943 to your computer and use it in GitHub Desktop.
Save Raynos/915943 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) {
var util = require('util'),
that = {};
that.displayAppName = function() {
util.debug('app name: ' + appName);
}
that.displayUserName = function() {
util.debug('user name: ' + userName);
}
return that;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment