Skip to content

Instantly share code, notes, and snippets.

@srijanshetty
Last active August 29, 2015 14:12
Show Gist options
  • Save srijanshetty/c88fff69428b158a075f to your computer and use it in GitHub Desktop.
Save srijanshetty/c88fff69428b158a075f to your computer and use it in GitHub Desktop.
Create a Nodejs CLI application
  1. Add the following lines to package.json
"preferGlobal": "true",
  "bin": {
    "commandname" : "path/to/command"
  }
  1. Add the following line to the main script:
#!/use/bin/env node
  1. Run npm link to locally test the command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment