Developer Tools
What Is pnpm, and Why Can It Save Disk Space Compared with npm?
pnpm stores package contents in a shared content‑addressable store and links them into each project, reducing duplicated copies of dependencies and saving disk space compared with npm’s per‑project node_modules layout.
💡Key Takeaways
- pnpm stores package contents in a shared content‑addressable store and links them into each project, reducing duplicated copies of dependencies and saving disk space compared with npm’s per‑project node_modules layout.
This article is based on the uploaded video about
npmandpnpm, then expanded into a technically grounded explainer. Images are inserted as public PNG URLs, with clear source notes. No base64 images and no SVG images are used.
Quick summary
Topic: npm, pnpm, Node.js package managers, node_modules, dependency storage
Core idea: npm and pnpm both manage packages in the JavaScript/Node.js ecosystem, but pnpm stores package contents differently. Instead of giving every project its own full copy of the same package, pnpm stores package content in a shared content-addressable store and links it into each project.
Practical conclusion: pnpm does not directly make your application runtime faster, but it can make dependency installation faster, reduce disk usage, and make project dependencies stricter and easier to reason about.
Illustration 1: npm in the Node.js ecosystem

Image source: Dashboard Icons / Homarr Labs, public PNG file.
Direct image URL: https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/npm.png
Source page: https://dashboardicons.com/icons/npm
License note: Dashboard Icons is an open-source icon collection distributed through GitHub/jsDelivr; verify the repository license before commercial use.
Technical note: This image is linked as a .png URL. It is not base64 and it is not SVG.
What is the video explaining?
The video explains a common pain point in Node.js development: when multiple projects use the same library, such as express, each project normally has its own node_modules directory. With traditional npm-style installation, each project tends to have its own dependency tree. This can grow disk usage quickly, especially on machines with many frontend repos, backend repos, experiments, or monorepos.
The video’s simplified model is: two projects use express, and each project also pulls in many transitive dependencies. If each project keeps its own copy, disk usage can multiply. The “~70% disk saved” figure in the video should be read as an illustrative estimate, not a universal guarantee.
Officially, npm describes npm install as a command that installs a package and the packages it depends on; by default, it installs modules listed in package.json into the local node_modules folder. npm also generates package-lock.json to describe the exact generated dependency tree so later installs can reproduce it more reliably.
Sources: npm Docs — npm install, package-lock.json
https://docs.npmjs.com/cli/v8/commands/npm-install/https://docs.npmjs.com/cli/v8/configuring-npm/package-lock-json/
Illustration 2: pnpm emphasizes speed and disk efficiency

Image source: pnpm official website.
Direct image URL: https://pnpm.io/img/features/fast-pumpkin.png
Source page: https://pnpm.io/
License note: This is an illustration from the official pnpm website. For commercial reuse or advertising, verify pnpm’s branding/asset terms.
Technical note: This image is linked as a .png URL. It is not base64 and it is not SVG.
What is npm?
npm is both a command-line client and a registry service for installing, managing, and publishing JavaScript packages. Many developers casually expand npm as “Node Package Manager,” but npm’s own brand policy says npm should not be explained as an acronym. A more accurate phrase in technical writing is the npm package manager or the npm client.
When you run:
npm install
npm reads package.json, resolves dependencies, downloads packages from the registry, and creates or updates node_modules. The package-lock.json file records concrete versions and the dependency tree, helping teammates and CI systems reproduce the same installation.
npm’s strengths are availability, compatibility, documentation, and community familiarity. For small projects or teams that do not need heavy monorepo or disk-space optimization, npm is still a reasonable default.
The real problem with node_modules
node_modules is not just a large folder. The real problems are broader:
- Duplicated packages across projects. Many repositories use the same packages, such as
react,express,lodash,typescript, orvite, but each repository may store its own copy. - Slow installs in cold-cache scenarios. More dependencies means more downloads, extraction, and file writes.
- Hidden or phantom dependencies. Some flat
node_moduleslayouts can let a project import packages it never declared directly inpackage.json. - Monorepo overhead. Many internal packages can share the same dependency versions, but naive installation still causes heavy disk and install work.
The question is not “is npm bad?” The better question is: “Is npm’s storage model still optimal for this specific project and workflow?”
What is pnpm?
pnpm is a JavaScript/Node.js package manager compatible with the npm registry, but it uses a different node_modules strategy. The pnpm homepage describes pnpm as a fast, disk-space-efficient package manager focused on saving time, saving disk space, and supporting monorepos.
The key difference is the content-addressable store. In simple terms, package files are stored once in a shared store on disk. When a project needs a package, pnpm links the package from the shared store into the project instead of copying all package contents again.
pnpm’s documentation explains that every file of every package inside node_modules is a hard link to the content-addressable store, and that symbolic links are then used to create the dependency structure compatible with Node.js.
Source: pnpm Docs — Symlinked node_modules structure
https://pnpm.io/symlinked-node-modules-structure
How pnpm saves disk space
Imagine you have 10 projects that all use [email protected]. With a traditional per-project install model, you can easily end up with 10 copies across 10 separate node_modules folders. With pnpm, the content of [email protected] is stored in a shared store, while each project links to that content.
A simplified model:
Traditional npm-style install:
project-a/node_modules/express
project-b/node_modules/express
project-c/node_modules/express
=> multiple copies across projects
pnpm:
global pnpm store/express
project-a/node_modules -> link to store
project-b/node_modules -> link to store
project-c/node_modules -> link to store
=> package content is reused
This is why the video says pnpm can save disk space. The actual percentage depends on the number of projects, dependency overlap, package versions, operating system, filesystem, and cache state.
Is pnpm faster than npm?
Often, yes, especially when the pnpm store/cache is already warm and multiple projects reuse the same dependencies. But it would be inaccurate to claim that “pnpm is always faster than npm.”
pnpm’s official benchmark page compares npm, pnpm, Yarn Classic, and Yarn PnP. The benchmark is updated daily and shows different results depending on whether cache, lockfile, and node_modules are already present. For example, the benchmark table recorded on June 14, 2026 shows several scenarios where pnpm is significantly faster than npm, but those are still specific benchmark scenarios.
Source: pnpm Benchmarks
https://pnpm.io/benchmarks
A safer statement is:
pnpm often improves install time and disk usage because of its content-addressable store and linking strategy, but actual results depend on the project, cache state, CI setup, disk performance, and package graph.
Illustration 3: npm logo assets and trademark usage need care

Image source: Official npm/logos GitHub repository, file white-space-guidelines.png.
Direct image URL: https://raw.githubusercontent.com/npm/logos/master/white-space-guidelines.png
Source page: https://github.com/npm/logos/blob/master/white-space-guidelines.png
License/trademark note: The npm/logos repository states that use of npm logo assets is governed by npm, Inc.’s trademark policy. Do not use npm assets in a way that implies sponsorship or endorsement.
Technical note: This image is linked as a .png URL. It is not base64 and it is not SVG.
Main benefits of pnpm
1. Lower disk usage
This is the easiest benefit to notice if you work on many Node.js projects. A development machine with many frontend and backend repositories often has repeated dependencies. pnpm reduces repeated physical copies by reusing a shared store.
2. Faster installs in many cases
When the store already contains a package, pnpm can link it instead of downloading and writing everything again. This is especially useful in monorepos or when switching among several projects.
3. Clearer dependency boundaries
pnpm’s stricter node_modules structure helps prevent a project from accidentally importing a package that is not declared in its own package.json. Some older projects may break after switching to pnpm, but that often reveals hidden dependency problems that already existed.
4. Stronger monorepo workflow
pnpm has workspace support and filtering commands that fit multi-package repositories. For teams with several internal packages, pnpm is often easier to scale than a basic npm workflow.
Caveats before switching from npm to pnpm
Do not switch just because a video says pnpm is “better.” Check these points first:
- Some older tooling may assume a flat
node_moduleslayout. - Your project may be importing hidden dependencies that are not listed in
package.json. - CI/CD needs to cache the pnpm store correctly.
- The team should standardize on one package manager; avoid npm, Yarn, and pnpm changing lockfiles in the same project.
- After switching, commit
pnpm-lock.yamland avoid editingnode_modulesdirectly.
When should you keep using npm?
npm is still appropriate when:
- The project is small.
- The team wants the default, low-configuration tool.
- The build/deployment workflow is already stable with npm.
- Disk usage, install speed, and monorepo management are not real pain points.
npm is not “wrong.” It is simply not always the most efficient tool for large multi-repo or monorepo workflows.
When should you try pnpm?
pnpm is worth trying when:
- You have many Node.js projects on the same machine.
node_modulesis very large.- You work in a monorepo.
- CI spends too much time installing dependencies.
- You want stricter dependency boundaries.
- You want to reduce disk usage on developer machines or CI runners.
A safe migration path
Try migration on a separate branch first:
corepack enable
corepack prepare pnpm@latest --activate
pnpm import
pnpm install
pnpm test
pnpm build
Then inspect dependencies:
pnpm why <package-name>
pnpm list
pnpm outdated
If the build fails because a package is missing, declare it directly:
pnpm add <package-name>
Avoid immediately forcing hoisting unless a real tool compatibility issue requires it. One of pnpm’s advantages is exposing hidden dependency assumptions.
Conclusion
The video’s core point is valid: duplicated dependencies are a real issue in Node.js development. npm remains popular and easy to use, but pnpm uses a smarter storage strategy for workflows with many repositories, large dependency graphs, or monorepos.
A concise comparison:
npm = simple, familiar, default, highly compatible
pnpm = disk-efficient, often faster to install, stricter dependencies
If you only maintain a small project, npm is probably enough. If you regularly work with many Node.js projects, large frontend/backend stacks, or monorepos, pnpm is worth testing.
References
- npm Docs —
npm install:https://docs.npmjs.com/cli/v8/commands/npm-install/ - npm Docs —
package-lock.json:https://docs.npmjs.com/cli/v8/configuring-npm/package-lock-json/ - npm Docs — Logos and Usage:
https://docs.npmjs.com/policies/logos-and-usage/ - pnpm official website:
https://pnpm.io/ - pnpm Docs — Symlinked
node_modulesstructure:https://pnpm.io/symlinked-node-modules-structure - pnpm GitHub repository — Background:
https://github.com/pnpm/pnpm - pnpm Benchmarks:
https://pnpm.io/benchmarks - Dashboard Icons — npm icon:
https://dashboardicons.com/icons/npm - npm/logos GitHub repository:
https://github.com/npm/logos
Image implementation notes
- This file does not use base64 images.
- This file does not embed SVG images.
- Images are linked as public PNG URLs.
- If you publish this file to a CMS, make sure the CMS allows remote images from
cdn.jsdelivr.net,pnpm.io, andraw.githubusercontent.com.
Written by PixelRouter Editorial Team
We publish deep, authoritative guides on AI infrastructure, API gateway security, cloud financial management, and system optimizations for developers.
FAQ
What is npm?
npm is the Node Package Manager client that reads package.json, resolves and downloads dependencies, and creates a local node_modules folder, recording exact versions in package-lock.json for reproducible installs.
What is pnpm?
pnpm is a JavaScript/Node.js package manager compatible with the npm registry that stores each package once in a global content‑addressable store and links it into each project’s node_modules, reducing duplicate copies.
How does pnpm save disk space compared with npm?
pnpm saves disk space by keeping a single copy of each package version in a shared store and creating hard links for each project, so multiple projects that depend on the same package reuse the same files instead of storing separate copies.
Is pnpm faster than npm?
pnpm often improves install time because it can link already‑cached packages instead of downloading and writing them again, especially in warm‑cache or monorepo scenarios, though actual speed varies by project and environment.
When should you keep using npm?
npm is suitable for small projects, teams that prefer the default low‑configuration tool, and when disk usage, install speed, and monorepo management are not major concerns.
When should you try pnpm?
pnpm is worth trying when you have many Node.js projects on the same machine, large node_modules folders, monorepo setups, slow CI installs, or you want stricter dependency boundaries and reduced disk usage.