As I continue to read through blogs, books, and even watch videos, it seems there are many unknown ways to use NPM; at least to the masses. I wanted to create this quick article to show some of the ways I use NPM, as well as speed up the process of many operations. Seriously, I’m surprised so few people seem to use this, but it’s all there, and any command can be reduced to 1-3 characters.

So let’s start looking at the various commands we can start to shorten, as well as how some are helpful:

Most Common Commands

Initialize:  npm ini

Install:  npm i <package>

Install – Save Dependency: npm -S <package>

Install – Save Development Dependency: npm -D <package>

Install – Save Optional Dependency: npm -O <package>

Uninstall: npm un <package>

 

Extra Shorthand Commands

Install Test: npm it <package>

Outdated: npm out

Upgrade: npm up

List Installed: npm lis

Outdated (Great for global): npm out

Prune: npm pru

Shrinkwrap: npm shr

 

I also want to point out this great NodeSource article on some other NPM tricks that are great to know.