Skip to content

Instantly share code, notes, and snippets.

@GianlucaGuarini
Last active April 18, 2019 14:17
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GianlucaGuarini/6f7ce495c55cb67d509180473623bfe0 to your computer and use it in GitHub Desktop.
Save GianlucaGuarini/6f7ce495c55cb67d509180473623bfe0 to your computer and use it in GitHub Desktop.
Use always `module.exports = Object.freeze({})`
const b = require('./b')
b.b = 'c'
module.exports = {
a: 'a'
}
module.exports = {
b: 'b'
}
const a = require('./a')
const b = require('./b')
console.log(b) // => watch out!! { b: 'c' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment