Skip to content

Instantly share code, notes, and snippets.

@junosuarez
Last active June 21, 2019 01:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save junosuarez/2aa476de72b48b474c98f58f8d2ab3b9 to your computer and use it in GitHub Desktop.
Save junosuarez/2aa476de72b48b474c98f58f8d2ab3b9 to your computer and use it in GitHub Desktop.
async cli app boilerplate
#!/usr/bin/env node
if (process.mainModule === module) setImmediate(() => main(process.argv).catch(e => console.log(e.stack) && process.exit(1)))
async function main(argv) {
console.log(argv.slice(2))
}
{"name":"boilerplate", "version":"0.0.0", "bin": "index.js"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment