npm downloads · last 12 months
npm is the package manager for JavaScript projects. It installs packages, tracks project dependencies, and provides commands for running scripts, giving developers a standard way to manage the software their projects rely on.
Its design centers on a command-line workflow and a package manifest, typically package.json, where dependencies and scripts are declared. This makes npm useful to individual developers and teams who want dependency choices and repeatable project tasks recorded alongside their code.
Common patterns include adding dependencies with npm install, recording development-only tools with npm install --save-dev, and defining commands in package.json for npm run. The package-lock.json file records a resolved dependency tree so installations can reproduce the versions selected for a project.
npm fits into JavaScript development from local setup through continuous integration and publishing workflows. Teams can use its install and run commands in development scripts and automated build jobs, while its package-management role connects projects to the JavaScript package ecosystem.
The supplied package information lists version 12.2.3, a 12.5 MB unpacked size, and a 3.0 kB gzip bundle size; those are distinct distribution measurements and should not be treated as equivalent. With 24.0M weekly downloads and 10.3K GitHub stars, npm is an established tool, though the listing also reports 848 open issues and a last-updated date of 2026-11-18.
npm is specifically a JavaScript package manager, so its dependency and script conventions are not a general-purpose solution for every language ecosystem. Projects should also review lockfile changes and dependency lifecycle behavior as part of installation and release workflows, rather than treating package installation as an opaque step.
- When a JavaScript project needs dependencies declared in package.json and installed through a standard command-line workflow, use npm install.
- When a project needs to distinguish runtime dependencies from development tooling, add the latter with npm install --save-dev.
- When contributors need repeatable dependency resolution, commit package-lock.json and use npm ci in automated installation workflows.
- When routine project tasks should be discoverable in the manifest, define scripts in package.json and invoke them with npm run.
- When setting up a JavaScript build or test job, use npm install or npm ci followed by the project's npm run scripts.
- When preparing a JavaScript package for distribution, use npm's package-management workflow to manage its declared dependencies and project scripts.
- If the project is not part of the JavaScript package ecosystem, npm's package.json and JavaScript dependency workflow are not a fit; use the package manager designed for that language.
- If a task only needs to execute an already-installed program, invoking that program directly may avoid adding npm installation steps to the workflow.
- If a repository deliberately uses a different JavaScript package-management convention, avoid mixing npm lockfiles and install workflows; follow the repository's established manager instead.
- If a build environment cannot access the package registry and dependencies are not already available, npm install cannot retrieve missing packages; provide a controlled dependency cache or pre-populated environment.
- If the project requires a minimal runtime image without package-management tooling, install dependencies during the build stage and ship only the required application artifacts.
- If the project needs package-management features for multiple language ecosystems, npm alone does not cover those ecosystems; use language-specific tooling alongside or instead of npm.
CORRECTIONS
Spot wrong data here?Spot wrong data on this page?
A short note helps us fix it.A short note helps us fix it. We read every one; confirmed fixes ship in the next nightly build.
Anonymous · No account · No email back