Last active
September 7, 2016 01:48
-
-
Save mhkeller/5ce1c92055c914af5f43525eed852cdf to your computer and use it in GitHub Desktop.
This file contains 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 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 |
This file contains 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
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