What is a npm command?
Experience Level: Junior
Tags: npm
Answer
npm has inbuilt actions that do something. Each action has an identifier using which it can be executed.The identifier is called a command.
An example of npm command is:
- list - a command that displys all installed modules
- install - a command that installs all modules mentioned in a file package.json in a property dependencies and devDependencies
- update - a command that updates all modules that have more recent version than the one youhave installed before
- outdated - a command that displays a list of outdated modules that your package is using
A command is executed from the command-line by typing:
npm <yourcommand>
If you wanted to run the commands above, you would run
npm list
npm install
npm update
npm outdated
Related npm job interview questions
What does npm stand for?
npm JuniorWhat is a difference between npm command and npm script?
npm JuniorUsing npm, how do you run a script that is defined in the package?
npm JuniorHow do you add a new devDependency to a file package.json?
npm JuniorWhat are scripts in a file package.json used for and how can they be helpful?
npm Senior