Created
April 30, 2019 11:37
-
-
Save VisualBean/52f570f9dc5d14c1ed073681a4ed45c9 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
const myMethod = (name) => { | |
console.log(`hello ${name}`); | |
} | |
if (require.main == module) { // True if run as script | |
myMethod(process.argv[2]); | |
} else { // Is Required | |
module.exports = myMethod; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment