I’m trying to build a command line app using NPM module commander.js.
With commander.js you get to run your commands on the terminal like this:
$ ./app --help
But i want to convert this into:
$ app --help
How can I achieve this, I’m going to release this to the NPM registry. Does it happen automatically or do i have to change something.
Note: The file name of the shell script is app!
Running file as:
means the file is in current directory, so you are saying run app file which is in current directory.
But if you have “.” which is current directory in env variale:
$PATH, you dont need to mention./app --help, you can simply sayapp --help, as shell knows where to find that file.If you want to add current directory in path do:
If you need more information and explanation please check here.
Hope this clarifies your query.