im trying to build a command line app using commander.js which is node module?
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, im going to release this to npm registry, deos it happen automatically or do i have to change something.
note: app is the file name of the shell script!
Running file as:
./app --help
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 say app --help
, as shell knows where to find that file.
If you want to add current directory in path do:
export PATH=$PATH:.
If you need more information and explanation please check here.
Hope this clarifies your query.