How it works
npm copies every dependency into every project's node_modules. pnpm keeps one content-addressed store per machine and hard-links files from it, so ten projects using the same library share a single copy on disk, and repeat installs are quick. It uses the same npm registry and the same package.json, with its own lockfile, pnpm-lock.yaml.
Its node_modules layout is strict: code can only import packages it has declared, which catches missing dependencies that npm's flat layout hides. Strong workspace support and filtering (run a command in one package and everything that depends on it) have made it a common choice for monorepos. A few older tools that assume a flat layout need a setting to work.
pnpm pricing
pnpm vs the alternatives
Related terms
More in Dev workflow and DevOps
Packages