Skip to content

Instantly share code, notes, and snippets.

@hassansin
Created December 20, 2014 11:23
Show Gist options
  • Save hassansin/6dee559bfa2852a1da6d to your computer and use it in GitHub Desktop.
Save hassansin/6dee559bfa2852a1da6d to your computer and use it in GitHub Desktop.
node.js - require module multiple times results in same object
//has to return object
module.exports = {
key: 'Hello'
}
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