6 Most Useful NPM commands that you may do not know yet

GP Lee
GP Lee
Jun 18 · 2 min read

1. `npm view <package>` (View information)

npm view <package> to view information about the package

$ npm view axios
$ npm view axios version> 0.19.2

2. `npm -h` (Helper Method)

Executable commands can be searched visa -h option

$ npm -h
$ npm install -h

3. `npm ls — only=<environment>` (Advanced `npm list` )

npm ls --only=dev --depth=0npm ls --only=prod --depth=0
npm ls --only=dev --depth=0 // --depth=0 is an optional
npm ls --only=prod --depth=0 // --depth=0 is an optional

4. `npm install <package>` (install command)

install is the most useful and frequently used npm command. npm install <module> command installs the specified modules

$ npm install mysql

5. `npm remove <package>` (remove command)

npm remove <module> deletes the installed modules (The opposite of install command)

$ npm remove mysql
npm uninstall mysql

6. `npm outdated` (show version of installed pacakges)

Can find available updated packages using npm outdated :

$ npm update [package name]
$ npm update

Thank you!


JavaScript In Plain English

Enjoyed this article? If so, get more similar content by subscribing to our YouTube channel!

JavaScript In Plain English

New articles every day.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store