Version: 1.7.0
Command line arguments
#
How to define options using command line argumentsSupposing you have a mocks
script added to your package.json
file, as seen in the get started chapter, then you can define options directly in the npm script using arguments:
Or you can define options when calling to the npm command:
Note the usage of two double dashes. Anything after the first double dashes is not an option of npm, but a parameter for the script that npm executes.
#
Plugins optionsOptions added by registered plugins can be defined also using command line arguments. Supposing you have registered a plugin which add a new option called "language", then you'll be able to run:
#
Boolean optionsFor Boolean
options having a true
default value, use the --no-
. prefix for disabling them. (Read commander documentation for further info)