Marcellvs
Marcellvs

Reputation: 461

Where can I find a list of all npm flags / tags / options?

I am looking for the meaning of the flag --u as in "npm run test --u" but I don't know where all the flags are documented.

Here at the bottom are some shorthands, but besides "gangster" and other cool ones, I couldn't find --u https://github.com/npm/npmconf/blob/master/config-defs.js#L405

Upvotes: 8

Views: 9071

Answers (2)

Kristof Villanueva
Kristof Villanueva

Reputation: 81

Here are the list of other npm flags that you might need:

-u or --update: Updates the packages installed in you current working directory

-g or --global: Installs the package globally rather than in your local working directory.

-v or --version: Displays the version of npm.

-h or --help: Displays help information for the npm command.

-l or --long: Shows extended information for the installed packages.

-j or --json: Outputs the npm registry data in json format.

-S or --save: Saves the package as a dependency in your package.json file. As of npm version 5, you might not need this anymore as packages will be saved by default into the package.json file

-D or --save-dev: Saves the package as a dev-dependency in the package.json file.

-O or --save-optional: Saves the package as an optional dependency in the package.json file.

-E or --save-exact: Saves the package at the exact version specified in the package.json file.

-P or --save-prod: Saves the package as a production dependency in the package.json file.

-B or --save-bundle: Saves the package as a bundled dependency in the package.json file.

Upvotes: 5

Pallamolla Sai
Pallamolla Sai

Reputation: 2493

"npm run test --u" ("--u") belongs to jest flag --updateSnapshot. If you run npm run test help or npm test help you will get all the flags of jest.

Inorder to get npm flags list or npm commands you can run this command npm -l

Upvotes: 1

Related Questions