100% Client-Side β’ 0 B Data Leaves Browser
web
NPM, PNPM & Yarn Commands Cheat Sheet
Side-by-side command reference for Node.js package managers: npm, pnpm, and yarn. Covers installing, scripts, auditing, lockfiles, and workspaces.
Package Installation & Dependencies
Install package as a runtime production dependencynpm i <pkg> | pnpm add <pkg> | yarn add <pkg>
Install package as devDependencynpm i -D <pkg> | pnpm add -D <pkg> | yarn add -D <pkg>
Install package globally on machinenpm i -g <pkg> | pnpm add -g <pkg> | yarn global add <pkg>
Deterministic clean CI install from lockfilenpm ci | pnpm install --frozen-lockfile | yarn --immutable
Uninstall package from dependencies and node_modulesnpm rm <pkg> | pnpm rm <pkg> | yarn remove <pkg>
Running Scripts & Executables
Execute lifecycle script defined in package.jsonnpm run <script> | pnpm <script> | yarn <script>
Download and execute CLI tool without global installationnpx <bin> | pnpm dlx <bin> | yarn dlx <bin>
Scan dependencies for known security CVE vulnerabilitiesnpm audit | pnpm audit | yarn npm audit
List packages that have newer versions availablenpm outdated | pnpm outdated | yarn outdated
Frequently Asked Questions
β’ Why is pnpm faster and more disk-efficient than npm?
pnpm uses a hard-linked, content-addressable global store, preventing duplicate packages across projects on your disk.