How do people expect a nodejs commandline application to be organised when you distributed it via npm?
Would they expect to have to build it? Install it locally or globally? Should it always output a bin.js? Do you need some kind of alias / script to run it (via bin.js?).
bin field in package.json to specify the entrypoint javascript file for your CLI.#!/usr/bin/env node to the top of your entrypoint js file.files field of package.jsonnpm install command line which a consumer can use to install your app, for example it could point at a github repository, or a package uploaded to the npm registry, which you can create with npm pack.Upon installing the app locally or globally, a script will be created in the path (or locally in node_modules/.bin), which will let your command line app be run conveniently.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With