Whenever I install any
npm package in my project, I always worry about disk space. Sometimes, I think about some centralized kind of thing, where I don’t need to install repetitive
npm packages in my projects, and I can reference them from centralized location. Let’s say, I have 100 projects on 256 GB disk space, it means I have 100 copies of each
npm package in my disk.
Every byte saved on disk can be used for something else than libraries code ___ when you have limited disk space on your machine.
I have been using
npm for a long time on my laptop, and I think, there could be one way to centralize the code libraries storage into a central place, and share it with all the projects you work on.
So, I googled for replacement of
npm package manager, and learned about
pnpm package manager. I would like to share my findings and summarize it with you. I am still not an expert in using
pnpm so I will try to put different supporting links in this post for my audience.
Lot of talks, now let’s come to the point.
What Is PNPM?
pnpm is an alternate package manager
PNPM is fast, disk space efficient package manager. __ pnpm.js.org
As said above, It is basically a drop-in replacement
pnpm install to download
So, this is the solution of my worries, which I mentioned above to save disk space for 100 projects having duplicate copies of
npm packages in each project. Now, using
pnpm, packages will be installed once globally, and then reference that first install across all of your projects.
For each version of package, there will be only one copy kept on the disk.
Hurry! I can now save gigabytes of disk space using PNPM.
How Fast Is the PNPM?
Ok, cool, I said it is fast, but how fast?__ a leading question. Let me share its performance benchmark link.
Check benchmark link here
Who’s Using this?
pnpm is specially used in those companies where there is a need to maintain a large number of projects with the same dependencies.
Microsoft is one of those company.
Read More About PNPM
This post is just a brief introduction
pnpm. So, I am going to share the links below.
Whatever the outcome of this race is, I do think
pnpm might be a better choice for some use cases.