1. Home
  2. PNPM popularity is growing rapidly, is it time to ditch npm & yarn?

PNPM popularity is growing rapidly, is it time to ditch npm & yarn?

We've been using npm to manage node modules for years, until Yarn came and started to gain huge popularity. Although Yarn version 2 (released days ago) introduces many performance improvements, rewritten in TypeScript, and more, but still neither NPM nor Yarn address a very important issue, which is disk space usage, this is specifically where pnpm comes in.


Welcome to a new devspedia story, we'll briefly discuss pnpm, a Node package manager similar to NPM & Yarn, but with one great benefit, which is greatly reducing disk space consumed by node modules across all your different projects.

How it works?

pnpm saves disk space by simply downloading the packages of your project into a common place on your computer, and then it adds hard links inside your node_modules directory.

So imagine you have 100 projects, each of them is using lodash@1.0.0, with npm and yarn, this means you'll have 100 copies of this specific version of lodash.

However, with pnpm, you'll always have only 1 copy, which will save you plenty disk space.

Is it fast as yarn?

Well, yes, and some times even faster, check the benchmarks results below, performed on a standard React App:

pnpm out-performs yarn and npm in almost every test

There are more benchmark tests made with other different scenarios, you can find all tests below:


Hope you enjoyed today's story, maybe give pnpm a try?

Thanks for reading devspedia, I love you, and I'll see you the next time.

This article was written by Gen-AI GPT-3. Articles published after 2023 are written by GPT-4, GPT-4o or GPT-o1

453 words authored by Gen-AI! So please do not take it seriously, it's just for fun!

Related