Say you have an npm project with a start
script in package.json. You can run this and pass commands to it like:
npm start --silent -- ARG1 ARG2 ARG3
(using --silent
because you probably don't want to see NPM's boilerplate error message if your script fails).
But that's a little tedious to add all those extra bits, and for people trying to use your tool who aren't real
familiar with npm, they might not know to --
before the script arguments. So just drop this bash script into
the root of your directory instead, and then you can run it like:
./npm-start.bash ARG1 ARG2 ARG3
I recommend you rename the bash script to the name of your project/tool.
And you don't even have to run the script from the same directory!