Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the "S" in "npm i -S" [duplicate]

Tags:

npm

I'm seeing this command on some packages and I wonder what the -s argument means, for example

npm i -S classnames flexboxgrid 

I mean, I know that, just like i is an abbreviation of install, it is an abbreviation of something, however I tried looking at npm help, npm help help, npm apihelp npm, npm help npm, nothing practically helpful there. This is like giving a dictionary to an illiterate; many words, but nothing about option arguments or their abbreviations.

like image 930
Yanick Rochon Avatar asked Nov 29 '16 14:11

Yanick Rochon


People also ask

What is the S flag in npm install?

-S is shorthand for --save , and it adds the package you're installing to the dependencies in your package. json file (which can be created with npm init ).

What is run S?

run-s command. A CLI command to run given npm-scripts sequentially.

What does Deduped mean in npm LS?

deduped is short for "deduplicated" (duplicates were removed). The documentation for npm dedupe explains how npm does this: Searches the local package tree and attempts to simplify the overall structure by moving dependencies further up the tree, where they can be more effectively shared by multiple dependent packages.

What is symbol in npm version?

npm uses the tilde (~) and caret (^) to designate which patch and minor versions to use respectively. So if you see ~1.0. 2 it means to install version 1.0.


1 Answers

The 'S' option is the Save option in npm. It adds the npm package to your dependencies for your project. You can also add the dependency manually by editing the package.json file.

To answer your question about getting help for npm, use the following command:

npm help i 

That will give you a description of all the options available for the 'i' option.

like image 79
bougiefever Avatar answered Oct 08 '22 14:10

bougiefever