Node Package Manager (NPM) is an awesome tool that installs nodeJS programs. It also makes it easier to specify and link dependencies. All nodeJS developers have used NPM one time or another. If you haven’t then you must be some sort of genius. I’ve put together my own personal cheat sheet of useful NPM commands that I’ll kindly share with you.
Search all NPM Packages
This displays all the available packages. There are also online tools that can help you search for NPM packages. Nipster sorts all packages by their GitHub rating. npmsearch sorts packages by relevance and downloads.
What’s installed on your system
npm ls installed
This command shows what’s on your system and also what’s available in the registry.
This command will search for new versions of all the packages installed. If there’s a newer version it’ll install it and points dependent packages at the new version if it satisfies their dependency. It will also remove the old versions if no other package names them as a dependency.
Create your own package.json
When this command is run within a folder, you’ll be asked a few questions before the package.json is written out.
Here are also some useful links I keep handy: