Bun vs pnpm
Bun: Fast local development loops and greenfield TypeScript projects.; pnpm: Monorepos and any Node project that wants reliable, fast installs.
| Field | Bun | pnpm |
|---|---|---|
| Pricing | Open source | Open source |
| Open source | Yes | Yes |
| Self-hostable | Yes | Yes |
| Ecosystem | JavaScript / TypeScript | JavaScript / TypeScript |
| License | MIT | MIT |
| Category | Runtimes | Build & packages |
Choose pnpm over Bun when
Choose it to change package manager without changing runtime. It is a package manager only, keeping packages in one content-addressable store shared across projects.
pnpm: a package manager only, which keeps packages in one content-addressable store shared across projects (motivation). Choose it to change package manager without changing runtime.
SourceChecked 25 November 2026
Choose Bun over pnpm when
Choose it when you also want to change runtime, or want the fastest installs Bun's docs claim: up to 25x faster than npm install. It skips dependencies' lifecycle scripts unless you list them in trustedDependencies.
Bun's package manager is part of the bun CLI and works in any project that has a package.json; the docs describe it as a Node.js-compatible replacement for npm, yarn and pnpm and claim installs up to 25x faster than npm install (bun install). That figure is Bun's own. Bun does not run postinstall and similar scripts of installed dependencies unless the package is listed in trustedDependencies (bun install). It writes a text bun.lock file and migrates package-lock.json, yarn.lock or pnpm-lock.yaml automatically when no bun.lock exists (lockfile). Workspaces are declared in the workspaces field of package.json and linked with the workspace: protocol (workspaces). The latest release on npm is 1.4.5, published 2026-11-19 (npm registry). It is a standalone tool that works in existing Node.js projects (bun install).
SourceChecked 25 November 2026
Bun
A fast all-in-one JavaScript runtime, package manager, bundler and test runner aimed at Node.js compatibility.
Choose Bun if
Fast local development loops and greenfield TypeScript projects.
Why it’s here
One executable is a runtime, package manager, test runner, bundler, type checker and formatter, and you can adopt one piece at a time: bun install and bun test work in an existing Node.js project without switching runtime (bun.com). TypeScript and JSX run with no configuration. Built-in clients for PostgreSQL, MySQL, SQLite (SQL), Redis (docs index) and S3 (S3) mean fewer dependencies for a typical back end.
Pick it when
- You are moving an npm, Yarn or pnpm project.
bun installmigratespackage-lock.json,yarn.lockorpnpm-lock.yamlto its text lockfile,bun.lock, on first run; npm 6 lockfiles are the exception (lockfile docs). - You ship a command-line tool as a single-file executable, built with
bun build --compile(compatibility page). - You start a new TypeScript service and want
.tsand.tsxfiles to run as they are, withbun checkreporting the same errors astscfrom TypeScript 7 (bun check).
Skip it when
Your production code depends on Node APIs that Bun marks as partial or missing on its compatibility page, which tracks Node.js v26:
node:async_hooks:createHookand the async ID functions are stubs. Bun invokes no hooks apart frominitforprocess.nextTick, and async IDs are always 0.node:crypto: BoringSSL lacks theed448,x448,rsa-pss,dsaandml-kem-512key types.node:cluster: load balancing HTTP requests across processes works only on Linux.node:v8:serializeuses JavaScriptCore's format, not V8's.node:seais not implemented;bun build --compilereplaces it.
Bun's stated policy is that a package that works in Node.js but fails in Bun is a Bun bug.
Current state
The latest release is 1.4.4, published 2026-10-22; it added bun fmt, a Prettier-compatible formatter (1.4.4 notes). Bun 1.4.0, released 2026-08-20, is the first version written in Rust instead of Zig (rewrite post) and added 1,517 tests from the Node.js test suite (1.4 notes). Anthropic acquired Bun in December 2025; the announcement states that Bun stays MIT licensed and the same team works on it (announcement). The official site is now bun.com.
Setup
From the installation guide:
curl -fsSL https://bun.com/install | bash # macOS, Linux
powershell -c "irm bun.sh/install.ps1|iex" # Windows 10 1809 or later
Watch out for
Bun runs TypeScript without checking types unless you pass --check or run bun check in CI (runtime docs). Its test runner is Jest-compatible, but its docs state that not everything in Jest is implemented (test docs), so run your suite before switching. Bun itself is MIT, but it statically links JavaScriptCore and WebKit under LGPL-2, which matters if you redistribute a modified bun binary (LICENSE.md).
pnpm
A fast, disk-efficient package manager for Node.js with strict dependency isolation and first-class workspaces.
Choose pnpm if
Monorepos and any Node project that wants reliable, fast installs.
Why it’s here
pnpm stores each version of a package once, in a content-addressable store, and hard-links or clones its files into every project that uses it (motivation). Its node_modules is not flat: by default only a project's direct dependencies are symlinked into the root of the modules directory, so code cannot import a package it does not declare (motivation). pnpm 12, the current line, is a native executable that needs no Node.js after installation (installation).
Pick it when
- You run a monorepo. A workspace is a
pnpm-workspace.yamlfile with apackageslist, and theworkspace:protocol makes an install fail instead of falling back to the registry when a local package is missing. Since 12.7.0,pnpm installalso creates that file from aworkspacesfield inpackage.json(workspaces). - You want protection against compromised packages by default. pnpm does not run dependency build scripts unless
allowBuildslists them, blocks transitive dependencies from git or tarball sources withblockExoticSubdeps, and does not resolve a version published less than a day ago (minimumReleaseAge, default 1440 minutes) (supply chain). - You want faster installs. On pnpm's own benchmark, reinstalling with a warm cache and lockfile took 407 ms with pnpm 12.23.0 against 4.45 s with npm 12.2.3 on the alotta-files project, and 1.17 s against 12.6 s on alotta-packages (benchmarks). The benchmark is pnpm's own.
Skip it when
- A tool in your chain fails on symlinks. The docs' remedy is
nodeLinker: hoisted, which builds a layout similar to npm's and gives up the strict one (motivation). - You want no separate package manager to install. pnpm is a separate install, either from npm or through a standalone script (installation).
Current state
Pnpm 12.23.0 was published on 2026-11-22 and 12.0.0 on 2026-08-26 (npm registry). pnpm 11 still gets releases: 11.29.0 shipped on 2026-11-22 (releases). The licence is MIT (LICENSE). pnpm 12 ships prebuilt binaries for Linux (glibc and musl), macOS, Windows, FreeBSD, NetBSD and Android (installation).
Setup
The pnpm npm package installs on Node.js 18 or newer; without Node.js, use the standalone script (installation):
npm install -g pnpm@latest
# or, with no Node.js installed:
curl -fsSL https://get.pnpm.io/install.sh | sh -
A monorepo needs a pnpm-workspace.yaml at its root (workspaces):
packages:
- packages/*
Watch out for
A dependency with a build script that allowBuilds does not list fails the install, because strictDepBuilds is on by default (supply chain). The one-day minimumReleaseAge keeps a version published in the last 24 hours from installing until you set minimumReleaseAge: 0 in pnpm-workspace.yaml (supply chain). pnpm 12 fails a command on an unrecognized setting in pnpm-workspace.yaml (ERR_PNPM_UNRECOGNIZED_WORKSPACE_SETTINGS) when the project pins a pnpm version that the running pnpm satisfies, and otherwise warns (12.0.0 release notes). A vulnerability scanner or SBOM generator must read both documents of pnpm-lock.yaml: a tool that reads only the first reports no dependencies and no vulnerabilities without failing (supply chain). pnpm 11 supports Node.js 22 and newer, while pnpm 10 and 12 also support Node.js 18 and 20, and on a platform with no pnpm 12 binary the docs say to install the JavaScript pnpm 11 (installation).