/ɛn piː ɛm/

n. “JavaScript's default package manager and registry for discovering, installing, and managing Node.js dependencies through a vast ecosystem of reusable modules.”

npm, short for Node Package Manager, is the default package manager for JavaScript and Node.js ecosystems, providing a command-line interface and public registry (npmjs.com) that hosts millions of open-source packages for seamless installation, versioning, and publishing. Developers declare dependencies in package.json manifests, where npm resolves complex transitive dependency trees using semantic versioning rules, installing them into a local node_modules directory while generating package-lock.json for reproducible builds across environments.

Key characteristics of npm include:

Semantic Versioning: Uses ranges like ^1.2.3 (compatible updates) or ~1.2.3 (patch-only) to manage compatibility.
Lockfile Precision: package-lock.json pins exact versions for deterministic CI/CD deployments.
Script Automation: Custom commands in package.json via npm run for build/test/start workflows.
Registry-Powered: Central hub at registry.npmjs.org stores package metadata and tarballs, powered by CouchDB.

Conceptual example of npm usage:

# Initialize project and install dependencies npm init -y npm install express lodash npm install --save-dev jest nodemon
Run scripts from package.json
npm run dev
npm test
npm run build

Conceptually, npm functions like a universal software librarian that automatically fetches, catalogs, and organizes entire dependency ecosystems from a single manifest file, eliminating manual downloads while enforcing version compatibility through lockfiles—transforming complex JavaScript projects from scattered scripts into structured, reproducible applications with one command, though often creating massive node_modules directories that demand periodic cleanup.