Skip to content

Instantly share code, notes, and snippets.

@Jonalogy
Last active March 18, 2018 13:14
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Jonalogy/fd73f5f6801675c43ef2ab21d8a1a06d to your computer and use it in GitHub Desktop.

Quick Notes of Node's module.export

console.log(module.exports); //-> {}
exports.apple = 'apple';
console.log(module.exports); //-> { apple: 'apple'}
module.exports['pear'] = 'pear';
console.log(module.exports); //-> { apple: 'apple', pear: 'pear'}
module.exports = 'uhoh';
console.log(module.exports); //-> uhoh
exports.tooBad = 'Too Bad...';
console.log(module.exports); //-> uhoh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment