diveintohacking
diveintohacking

Reputation: 5183

What does -s mean in npm command?

I saw the following command that includes -s option. What does it(-s) mean? Because I didn't see the option in package.json.

$ npm run dev -s

Upvotes: 3

Views: 1970

Answers (1)

Mick
Mick

Reputation: 125

The flag -s stands for "silent" and is applied to npm, not to the command in the dev script.

The -s flag prevents npm from screaming at you when the command exits with a non-zero status, i.e. when the command fails. It also won't create an npm_debug.log file.

To test out the difference yourself you can do the following in a new directory.

npm init -y
npm run test
npm run test -s

Note 1: I prefer to write npm run -s dev to limit possible confusion.

Note 2: To pass the -s flag to the dev script, you would run npm run dev -- -s.

Upvotes: 6

Related Questions