Clue Mediator

Useful NPM commands shorthand

📅August 8, 2022

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

  1. Install a package
  2. Install a package globally
  3. Install a package as a dev dependency
  4. Update a package
  5. Uninstall a package
  6. Check node version
  7. Create default package.json
  8. Get help

1. Install a package

## longhand
npm install package-name

## shorthand
npm i package-name

2. Install a package globally

## longhand
npm install --global package-name

## shorthand
npm i -g package-name

3. Install a package as a dev dependency

## longhand
npm install --save-dev package-name

## shorthand
npm i -D package-name

4. Update a package

## longhand
npm update package-name

## shorthand
npm up package-name

5. Uninstall a package

## longhand
npm uninstall package-name

## shorthand
npm un package-name

6. Check node version

## longhand
npm --version

## shorthand
npm -v

7. Create default package.json

## longhand
npm init --yes

## shorthand
npm init -y

8. Get help

## longhand
npm help

## shorthand
npm

I hope you find this article helpful.
Thank you for reading. Happy Coding..!!