Useful NPM commands shorthand
Today, we’ll show you the most commonly used NPM commands shorthand. You can check the list of examples that are created using NPM Package.
Useful NPM commands shorthand
- Install a package
- Install a package globally
- Install a package as a dev dependency
- Update a package
- Uninstall a package
- Check node version
- Create default package.json
- Get help
1. Install a package
1 2 3 4 5 | ## longhand npm install package-name ## shorthand npm i package-name |
2. Install a package globally
1 2 3 4 5 | ## longhand npm install --global package-name ## shorthand npm i -g package-name |
3. Install a package as a dev dependency
1 2 3 4 5 | ## longhand npm install --save-dev package-name ## shorthand npm i -D package-name |
4. Update a package
1 2 3 4 5 | ## longhand npm update package-name ## shorthand npm up package-name |
5. Uninstall a package
1 2 3 4 5 | ## longhand npm uninstall package-name ## shorthand npm un package-name |
6. Check node version
1 2 3 4 5 | ## longhand npm --version ## shorthand npm -v |
7. Create default package.json
1 2 3 4 5 | ## longhand npm init --yes ## shorthand npm init -y |
8. Get help
1 2 3 4 5 | ## longhand npm help ## shorthand npm |
I hope you find this article helpful.
Thank you for reading. Happy Coding..!!