🖥️npm

➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the npm command with important options and switches using examples.

▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁

#                ███╗   ██╗██████╗ ███╗   ███╗
#                ████╗  ██║██╔══██╗████╗ ████║
#                ██╔██╗ ██║██████╔╝██╔████╔██║
#                ██║╚██╗██║██╔═══╝ ██║╚██╔╝██║
#                ██║ ╚████║██║     ██║ ╚═╝ ██║
#                ╚═╝  ╚═══╝╚═╝     ╚═╝     ╚═╝
                                             
                                            
# Every command shown here can be used with the `-g` switch for global scope

# Install a package in the current directory
npm install <package>

# Install a package, and save it in the `dependencies` section of `package.json`
npm install --save <package>

# Install a package, and save it in the `devDependencies` section of `package.json`
npm install --save-dev <package>

# Show outdated packages in the current directory
npm outdated

# Update outdated packages
npm update

# Update `npm` (will override the one shipped with Node.js)
npm install -g npm

# Uninstall a package
npm uninstall <package>

# List all global top level modles, then remove ALL npm packages with xargs
npm ls -gp --depth=0 | awk -F/ '/node_modules/ && !/\/npm$/ {print $NF}' | xargs npm -g rm; npm -g uninstall npm

#==============================##==============================#
# CMD NPM						       #
#==============================##==============================#
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

  █║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌

              ██╗ ██╗ ██████╗  ██████╗ ██╗  ██╗███████╗██████╗
             ████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
             ╚██╔═██╔╝██║  ██║██║   ██║ ╚███╔╝ █████╗  ██║  ██║
             ████████╗██║  ██║██║   ██║ ██╔██╗ ██╔══╝  ██║  ██║
             ╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
              ╚═╝ ╚═╝ ╚═════╝  ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═════╝

               █║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░