Why PNPM? WTF?

Why PNPM? WTF?

Written by Tony Lea on Jan 23rd, 2025 Views Report Post

If you are not regularly engaged with the JavaScript ecosystem, you may get overwhelmed by all the options available 🥵

In fact, even if you're trenched in the JS ecosystem, you can still feel overwhelmed. Whenever I see something like the following image:

Screenshot 2025-01-23 at 9.25.01 AM.png

I immediately disregard all options except for NPM. Why are there so many options 🤦‍♂️

Curiosity finally got the better of me, and I decided to figure out what the hell PNPM is and whether or not I should give a f*ck. So, here's a quick write-up to help anyone else screaming internally, "Why the hell do we need another package manager?"

TLDR

PNPM is faster and saves disk space. The extra P stands for Performant. Instead of adding all the dependencies to a single project, PNPM uses a symlink strategy to share dependencies across projects. That's it! That's all you need to know.

But honestly, PNPM should stand for Please No-more Package Managers. Am I right? Am I right?... (nervous chuckle)... Yeah, okay. Anyway,… moving on. 🫠

Managing Versions

You may be wondering, like I was, how it manages different versions. Apparently, that is one of the big selling points for why developers choose PNPM.

  • If two projects use the same dependency version, PNPM symlinks them in a shared place.
  • If two projects need different versions of the same dependency, PNPM will store both versions in a shared place but save disk space by reusing common files.

The way PNPM handles dependencies is what makes it faster.

Should you use PNPM

It's totally up to you. For now, I will stick to NPM because that's what I'm used to. If that changes, I'll be sure to update this post. Or I'll forget. Who knows?

Damn You Javascript

This is a prime example of why web development has earned its reputation as "difficult to learn." Every week, a new library or package is released that claims to be "better," "faster," or "revolutionary," but it mainly just adds to the confusion.

Ending on a Positive Note

The JS ecosystem may be chaotic, but at least you have options for everything under the sun. So, Whether you're sticking with NPM out of habit or switching to PNPM to save some disk space, all that matters is being productive and writing code.

Grab your favorite package manager, write some code, and one day, JavaScript may finally chill out. Probably not, though. 😂

Comments (0)