Skip to content

Instantly share code, notes, and snippets.

@ralt
Created December 7, 2012 15:38
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 ralt/4234017 to your computer and use it in GitHub Desktop.
Save ralt/4234017 to your computer and use it in GitHub Desktop.
Cached exports example
var lib = require('./lib'),
lib2 = require('./lib2');
lib2.f();
console.log(lib.a); // 2
module.exports = {
a: 1
};
var lib = require('./lib');
module.exports = {
f: function() {
lib.a = 2;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment