npm

npm is the default package manager for Node.js and hosts the world's largest software registry. It handles dependencies, scripts, and publishing packages across the JS ecosystem.
LTD available?
No
Pricing model
Free

What is npm?

npm is the default package manager for Node.js and the registry that hosts most of the JavaScript ecosystem. It's two things at once: a command-line tool for managing packages in your project, and a public registry where over two million packages are published and freely available. If you're doing any JavaScript development, you're almost certainly using npm or one of the tools built on top of it.

Managing dependencies

You declare your project's dependencies in a package.json file, and npm resolves and installs them into a node_modules directory. The package-lock.json file records the exact version of every installed package, including transitive dependencies, so that anyone who clones the project gets exactly the same tree. This makes builds reproducible across machines.

npm scripts

The scripts section of package.json is where most JavaScript projects define their common tasks — start, build, test, lint. Running npm run build executes whatever command you've wired to that name, whether it's Vite, Webpack, tsc, or anything else. This gives projects a consistent interface regardless of what's happening under the hood.

The registry

The npm registry is the world's largest software registry by package count. Most open-source JS libraries are published there. You can also publish private packages to the registry, useful for shared internal libraries across a team or organisation. Scoped packages (prefixed with @) let you namespace packages under an organisation name.

Alternatives

Yarn and pnpm are the main alternatives to npm. pnpm in particular has gained significant traction because it uses a content-addressable store and hard links to avoid duplicating packages across projects, which saves disk space and speeds up installs. npm has closed much of the performance gap over recent versions, but pnpm remains meaningfully faster for large monorepos.

Reviews

Be the first to review

Share your experience to help others decide.

Reviews

Be the first to review

Share your experience to help others.

Tags

package-managernodejavascriptdependenciesregistry

© Dev tools 2026. All rights reserved