0% found this document useful (0 votes)
48 views

NPM Cheatsheet

zxvccx
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views

NPM Cheatsheet

zxvccx
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

npm is the default package manager for

A T I N Y C H E A T S H E E T O N
the Node.js

npm init
Create a new
npm project/package. Add the
-y flag to initialize with default
configuration
npm i [package]
Install a [package].
Add -D flag to install as
devDependency
Add -g flag to install globally
npm rm [package]
Remove a [package].
Add -D flag to remove a
devDependency
Add -g flag to remove globally

npm up [package]
Update a [package].
Add -g flag to install globally
npm ls
List all the packages
Add the flags -g --depth 0 to list
global packages
npm run [script]
Run the script
called [script] as mentioned
in package.json
npm install
Install all the packages
mentioned in package.json of
the current project
npm install -g npm
Update npm to the latest
version
npm audit
Scan and list all the
vulnerabilities in the project.
npm audit fix will fix the
vulnerabilities as well
npm docs [package]
Show docs/readme of
[package]
npm xmas
npm visnup
npm substack
Fun commands to try yourself!

godcrampy sahil.surge.sh

You might also like