Hacker News new | ask | show | jobs
by ironarm 2947 days ago
I've been enjoying pnpm as my node package manager for about a year now.

<https://github.com/pnpm/pnpm>

It centrally downloads all of the modules and then "symlinks" them into your `node_modules` folder.

This is nice because one, it uses less disk space, two, if you've already downloaded a package at a particular version it links it out of the local repo.

Also uses shrinkwrap to handle package locking.

4 comments

I agree, pnpm is excellent. The node_modules directory can easily take up hundreds of megabytes, and the storage space savings that pnpm provides are really convenient when you write a lot of small projects with similar sets of dependencies. I did a comprehensive benchmarking comparison on npm, pnpm, and yarn a while back, and pnpm was the clear winner for my needs [1]. Those benchmarks are admittedly outdated now because, as this submission points out, npm 6 introduced significant improvements over npm 5. Despite that, pnpm is still an underappreciated contender in the space.

- [1] https://github.com/pnpm/pnpm

- [2] https://intoli.com/blog/node-package-manager-benchmarks/

Yes, pnpm is awesome. Only occasional issue was for me, that it didn't installed peerDependencies by default. Also not sure if it's gonna work in environments like react-native (never tested).
Neither do yarn or npm AFAIK
I always wondered why npm didn't use symlinks more... (at all?)
Been using pnpm for about 3 months solid now and I'm a huge fan. Most packages rely on node's built-in resolve system and have no problem with pnpm's symlinks. For packages like Jest and Webpack that have some custom resolve logic, I just use the `--shamefully-flatten=true` option and everything is perfect.

Saved me over 6GB on my file system across several projects. Big thumbs up from me.