xuka
xuka

Reputation: 119

npm, pnpm, yarn or pkglink for saving time and disk space?

I'm really frustrated by the size of node_modules folder that gets created every time for every project. So, I've been looking for some time-space saving solutions. And I found PNPM ( https://pnpm.js.org/ ) , Yarn ( https://yarnpkg.com/ ) and Pkglink ( https://github.com/jeffbski/pkglink ). But I'm not sure which is better to serve my purpose.

Things I'm looking forward to solving:

  1. I don't want to re-download the same packages over and over again
  2. I don't want the same packages to be in multiple projects and eat up space
  3. I want a stable, fast and disk space saving solution

Looking for experts advice.

Upvotes: 2

Views: 882

Answers (1)

Zoltan Kochan
Zoltan Kochan

Reputation: 7706

I think pnpm is satisfying all your requirements.

pnpm will only save a package once on a disk, and it will use hard links to add the package to different projects on the disk.

You could achieve the same with Yarn+pkglink or npm+pkglink but that would be a two-step process. First, you'd run npm|yarn install then pkglink to remove the duplicates.

Upvotes: 3

Related Questions