Useful Shorthand npm Commands
As professional code hackers, we like to ensure we are typing as little as possible.
Here are some shorthand npm commands that I regularly use that have added YEARS* of productivity to my workflow
*Years might be an exaggeration...
Install a package
Longhand 🚫
npm install my-package-name
Shorthand 👇
npm i my-package-name
Install a dev dependency
Longhand 🚫
npm install --save-dev my-package-name
Shorthand 👇
npm i -D my-package-name
Install a global dependency
Longhand 🚫
npm install --global my-package-name
Shorthand 👇
npm i -g my-package-name
Update a package
Longhand 🚫
npm update my-package-name
Shorthand 👇
npm up my-package-name
Uninstall a package
Longhand 🚫
npm uninstall my-package-name
Shorthand 👇
npm un my-package-name
Create default package.json
Longhand 🚫
npm init --yes
Shorthand 👇
npm init -y
Let me know in the comments below what you will do with all your newly earned free time. 😉 💬
Follow me on Twitter or connect on LinkedIn.
🚨 Want to make friends and learn from peers? You can join our free web developer community here. 🎉