I am running my module from a script in package.json
. When I add command line arguments like below, it only passes the args that don't start with a minus (-):
npm run myscript -one two
The args I get are:
[
'/home/myhome/apps/node-v6.4.0-linux-x64/bin/node',
'/home/myhome/Development/code/node_modules/.bin/mymodule',
'two'
]
Any arg I add with one or more minus characters at the beginning aren't passed. Even if I put them in quotes like npm run myscript "--one two"
or npm run myscript "--one" two
- it still won't send it to my module.
How do I get those command line args?