Created
December 20, 2014 11:23
-
-
Save hassansin/6dee559bfa2852a1da6d to your computer and use it in GitHub Desktop.
node.js - require module multiple times results in same object
This file contains hidden or 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
//has to return object | |
module.exports = { | |
key: 'Hello' | |
} |
This file contains hidden or 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
var m1 = require('./module') | |
console.log(m1); | |
m1.key = "World"; | |
var m2 = require('./module') | |
console.log(m2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment