pnpm

pnpm ("performant npm") is a JavaScript package manager built by an open-source community as a faster, disk-space-efficient alternative to npm and Yarn. It's the #20 most-used developer tool, reported in roughly 13.4% of developer surveys. Instead of duplicating every package into every project's node_modules folder, pnpm stores one copy of each package version in a global content-addressable store and hard-links it into projects, saving huge amounts of disk space on machines with many JavaScript projects.

Quick facts
Type: JavaScript/Node.js package manager
Made by: pnpm open-source community
License: Free / open-source (MIT)
Platforms/Hosting: Cross-platform (Windows, macOS, Linux), runs on Node.js
Primary use case: Installing and managing dependencies for JavaScript/TypeScript projects, especially monorepos
Jump to: ExampleGetting startedBest for

Example

pnpm's commands mirror npm's closely, so switching over is nearly a drop-in swap.

# add a dependency
pnpm add react react-dom

# add a dev-only dependency
pnpm add -D typescript

# run a script from package.json
pnpm run build

Getting started

Install pnpm globally via npm's corepack, then use it in place of npm install in any existing project.

# enable via corepack (bundled with Node.js 16.13+)
corepack enable pnpm

# or install directly
npm install -g pnpm

# install all dependencies for a project
pnpm install
Best for: Monorepos and teams juggling many JavaScript projects on one machine — pnpm's shared content-addressable store and strict dependency resolution catch "phantom dependency" bugs that npm and Yarn allow to slip through.