pnpm (short for performant npm) is a fast, disk-space-efficient package manager for Node.js. It is largely compatible with npm’s package ecosystem and uses package.json, but installs dependencies differently.
How it works
pnpm keeps package files in a global, content-addressable store. Projects link to those files instead of keeping a separate physical copy of every dependency. If several projects use the same version of a package, pnpm stores its files only once.
It also creates a non-flat node_modules structure. Only packages declared as direct dependencies are available at the project root; transitive dependencies remain isolated. This prevents code from accidentally importing an undeclared package—sometimes called a phantom dependency.
The result is:
- lower disk usage across projects
- fast installs, especially when packages are already in the store
- stricter and more reproducible dependency resolution
- built-in support for monorepo workspaces