Skip to content

Instantly share code, notes, and snippets.

@VisualBean
Created April 30, 2019 11:37
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 VisualBean/52f570f9dc5d14c1ed073681a4ed45c9 to your computer and use it in GitHub Desktop.
Save VisualBean/52f570f9dc5d14c1ed073681a4ed45c9 to your computer and use it in GitHub Desktop.
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