Skip to content

Instantly share code, notes, and snippets.

@insin
Created March 22, 2011 11: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 insin/881067 to your computer and use it in GitHub Desktop.
Save insin/881067 to your computer and use it in GitHub Desktop.
Akshell modules - add to exports, don't replace it
repr([1, 2, 3, 4].map(function(i) { return require('./testrequire' + i).foo; }))
["bar", undefined, undefined, "bar"]
exports.foo = "bar";
module.exports = {foo: "bar"};
exports = {foo: "bar"};
function extend(d, s) {
for (p in s) {
if (s.hasOwnProperty(p)) {
d[p] = s[p];
}
}
}
extend(exports, {foo: "bar"});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment