Skip to content

Instantly share code, notes, and snippets.

@iotashan
Created September 12, 2012 17:00
Show Gist options
  • Select an option

  • Save iotashan/3708122 to your computer and use it in GitHub Desktop.

Select an option

Save iotashan/3708122 to your computer and use it in GitHub Desktop.
commonJS as a singleton lib
var MyModule = require('MyModule.js');
MyModule.someFunction(...);
var MyModule = {};
// auth info
MyModule.somevariable = 'http://www.google.com/';
MyModule.someFunction = function(...) {
...
}
module.exports = MyModule;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment