Version: 1.4.0

Command line arguments

How to define options using command line arguments#

Supposing you have a mocks-server 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:

"scripts": {
"mocks-server" : "mocks-server --path=./mocks --log=verbose --watch=false"

Or you can define options when calling to the npm command:

npm run mocks-server -- --delay=300

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 options#

Options 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:

npm run mocks-server -- --language=Es-es