Created
March 22, 2011 11:12
-
-
Save insin/881067 to your computer and use it in GitHub Desktop.
Akshell modules - add to exports, don't replace it
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repr([1, 2, 3, 4].map(function(i) { return require('./testrequire' + i).foo; })) | |
["bar", undefined, undefined, "bar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.foo = "bar"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = {foo: "bar"}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports = {foo: "bar"}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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