The `/-/pnpr/v0/verify-lockfile` endpoint already runs a packument metadata fan-out to check the client's policy (minimumReleaseAge, trustPolicy), so it observes each package's `dist.unpackedSize` / `fileCount` — but it discarded them and returned only the verdict. Surface them as the same sized `package` frames the resolve frozen fast path emits, ahead of the verdict, so a frozen restore can prioritize its largest pending tarball downloads. The data comes for free: no extra fetches, the verifier already had it. Server (pnpr): `handle_verify_lockfile` keeps the verifier's `ObservedDistStats` and, when present, prepends `frozen_package_frames` before the `done` frame. OSV violations still suppress the frames — a vulnerable lockfile must not seed any download. A verdict-cache hit fetched no metadata, so it still sends the bare verdict. Client (pacquet-pnpr-client): add a `Package` variant to `VerifyFrame` and a `verify_lockfile_streaming(opts, on_package)` method; `verify_lockfile` becomes the no-op-callback wrapper. Install (pacquet-cli): on the frozen verify path, drive the tarball prefetch from the verify stream's frames instead of firing the whole lockfile up front unprioritized. Each frame is joined to the client's own lockfile entry by `integrity` — the announced URL is route_url'd and would miss the materialization pass's mem-cache key, whereas the client's own `tarball_url_and_integrity` is the key. A completeness backstop covers the verdict-cache-hit and partial-fan-out cases. The priority semaphore fixes a download's weight at queue-registration time, so reprioritizing an already-queued download isn't possible — the prefetch has to learn the size before it spawns, hence the stream-driven rework. Rust-only: the TS pnpr client calls /resolve only and skips package frames, so there is no TS counterpart to mirror.
简体中文 | 日本語 | 한국어 | Italiano | Português Brasileiro
Fast, disk space efficient package manager:
- Fast. Up to 2x faster than the alternatives (see benchmark).
- Efficient. Files inside
node_modulesare linked from a single content-addressable storage. - Great for monorepos.
- Strict. A package can access only dependencies that are specified in its
package.json. - Deterministic. Has a lockfile called
pnpm-lock.yaml. - Works as a Node.js version manager. See pnpm runtime.
- Works everywhere. Supports Windows, Linux, and macOS.
- Battle-tested. Used in production by teams of all sizes since 2016.
- Experimental Rust port. Includes pacquet, an experimental port of the CLI written in Rust.
- See the full feature comparison with npm and Yarn.
To quote the Rush team:
Microsoft uses pnpm in Rush repos with hundreds of projects and hundreds of PRs per day, and we’ve found it to be very fast and reliable.
Platinum Sponsors
|
|
|
Gold Sponsors
|
|
|
|
|
|
|
|
|
|
|
Silver Sponsors
|
|
|
|
|
|
|
|
|
|
|
| ⏱️ Time.now |
Support this project by becoming a sponsor.
Background
pnpm uses a content-addressable filesystem to store all files from all module directories on a disk. When using npm, if you have 100 projects using lodash, you will have 100 copies of lodash on disk. With pnpm, lodash will be stored in a content-addressable storage, so:
- If you depend on different versions of lodash, only the files that differ are added to the store.
If lodash has 100 files, and a new version has a change only in one of those files,
pnpm updatewill only add 1 new file to the storage. - All the files are saved in a single place on the disk. When packages are installed, their files are linked from that single place consuming no additional disk space. Linking is performed using either hard-links or reflinks (copy-on-write).
As a result, you save gigabytes of space on your disk and you have a lot faster installations!
If you'd like more details about the unique node_modules structure that pnpm creates and
why it works fine with the Node.js ecosystem, read this small article: Flat node_modules is not the only way.
💖 Like this project? Let people know with a tweet
Getting Started
Benchmark
pnpm is up to 2x faster than npm and Yarn classic. See all benchmarks here.
Benchmarks on an app with lots of dependencies:
License
MIT, except the pnpr/ directory, which is source-available under the PolyForm Shield License 1.0.0.