Is pnpm more eco-friendly ?

Described as a "Fast, disk space efficient package manager", pnpm is the new package manager on the block. The main motivation behind it is to improve developer experience by speeding up install speed and reducing the amount of disk space taken up by our infamous node_modules.

node-modules.webp

Here's the gist of how it works: instead of downloading 100 times react if you have 100 react projects, pnpm will store a copy of the dependency in a content addressable store. This means that it is able to retrieve the library based on its content. Running pnpm update will only update the files that you need in your store. The dependency is then hard-linked in your project, eliminating the need to download a full package.

This helps the planet in 2 ways. Around 30% of emissions come from usage of our devices. This accounts for the energy required to power your laptop, and the usage of the network.

lyfecycle.png

Since pnpm helps us reduce not only the amount of data stored on our machine, but also the amount of requests sent, the argument can be made that pnpm is more eco-friendly ! And on top of that, we've found at Enverse that it is indeed blazingly fast. You can easily get started today by following the instructions here: Installation Guide. If you have Homebrew on Mac:

brew:

$ brew install pnpm

corepack:

$ corepack enable
$ corepack prepare pnpm@<version> --activate

With cURL:

$ curl -fsSL https://get.pnpm.io/install.sh | sh -

Many more ways: Pnpm installation guide

Happy Green Coding !