The situation in your example command is there are two programs being invoked, and both of them use command-line arguments. You are invoking npm
, and npm
will obey the run script
arguments to invoke the script automation_main.ts
. None of the arguments are enclosed in quotes (perhaps that's necessary for this kind of npm command).
The argument -i payroll_integration
is clearly intended for the script and not for npm. How do you convince npm to not try to parse it (which will probably make it error out)?
The answer: you insert an argument that tells npm that the rest of words on the line are not npm's arguments. This is --
, which means "your arguments stop here, don't worry about the rest". Npm will remove its arguments up to and including the --
, and invoke the script with the rest of the line present for the script to parse and use.
Note that, while bash
and npm
understand the --
argument (as many, many other GNU utilities do), there are programs that don't understand it and won't behave the way I described here for npm
.