npm
Manage JavaScript packages
TLDR
Create a package.json file with default values (omit --yes to do it interactively)
Download all the packages listed as dependencies in package.json
Download a specific version of a package and add it to the list of dependencies in package.json
Download the latest version of a package and add it to the list of dev dependencies in package.json
Download the latest version of a package and install it globally
Uninstall a package and remove it from the list of dependencies in package.json
List all locally installed dependencies
List all top-level globally installed packages
SYNOPSIS
npm
PARAMETERS
init
Create package.json interactively
install [pkg]
Install packages
uninstall
Remove package
update [pkg]
Update packages
run
Run script from package.json
test
Run test script
start
Run start script
publish
Publish package to registry
audit
Run security audit
ls
List installed packages
-g, --global
Operate on global packages
-D, --save-dev
Save as dev dependency
--production
Install only production deps
DESCRIPTION
npm (Node Package Manager) is the default package manager for Node.js. It manages project dependencies, runs scripts, and provides access to the npm registry containing hundreds of thousands of packages. npm handles package installation, version management, and project configuration.
CAVEATS
node_modules can become very large. Lock files should be committed for reproducible builds. Security vulnerabilities in dependencies are common. Global installs may require sudo.
SHORTCUTS
npm i = npm install
npm rm = npm uninstall
npm up = npm update
npm t = npm test


