PNPM: Because to work more flexible we start from the bottom

Riccardo Canella
Jobtome Engineering
4 min readJun 9, 2022

--

pnpm is a nodejs package manager which has as its main objective to reduce the number of packages installed on your local machine and to speed up the installation of packages.

How does all this work?

To do this, pnpm, uses two really simple concepts but are not so easy to implement:

  1. Sharing of the dependencies. All the dependencies will be installed in a unique store and linked (hard or soft, depending on the package) in your node_modules folder, this means that if you use the same package (and version) on 100 projects you will install it just once.
  2. Light package updates. When you update a package, using the pnpm update command, only the files changed inside the package will be saved in the store, so you won’t have a redundant and complete folder for all your versions of the same package but a complete version and the diff of the new version.

In the end, pnpm changes the structure inside the node_modules folder to better manage symlinks and other magic stuff but all of this is transparent to you. You will be able to use your packages inside your code as always at the cost of using pnpm instead of using npm or yarn

How to install it?

--

--

Riccardo Canella
Jobtome Engineering

Riccardo Canella @ricanella92 Love #basket, #bike and #HIMYM since my childhood. #Fullstack #Javascript addicted - https://canellariccardo.it