Skip to content

Instantly share code, notes, and snippets.

@mhkeller
Last active September 7, 2016 01:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhkeller/5ce1c92055c914af5f43525eed852cdf to your computer and use it in GitHub Desktop.
Save mhkeller/5ce1c92055c914af5f43525eed852cdf to your computer and use it in GitHub Desktop.
var myModule = require('./my-module.js')
myModule.yo()
// prints 'yo'
myModule.myDefault()
// prints 'hi'
myModule.whisper()
// error `whisper` is undefined because we haven't exported it
function yo () {
console.log('yo')
}
function hi () {
console.log('hi')
}
function whispher () {
console.log('pssst')
}
module.exports = {
yo: yo,
myDefault: hi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment