DEV Community

Max Bantsevich for dev.family

Posted on

What is a package manager and what is the difference between YARN, NPM, PNPM?

Image description

I really want to joke about a package with packages. But no, this article is about something else. First, let’s figure out why I wrote it and who it might be useful for:

Front-end developers like me, who always used the standard manager and were not interested in others, can relate. And then suddenly, they wanted something new, and had to read more than one article to gather information and choose the appropriate option.

Back-end developers who are transitioning to Node.js.
Juniors who only joke about packages and have only heard of them.

Why did I even start messing with packages?

I believe that if a developer is completely unconnected to business goals, he will be of little use. He should understand how to choose technologies, to build the architecture so that the product would work best in the end. For example, if you use native JS instead of a reactive framework, it is logical to assume that the development speed will be slower, and therefore the final product will be much more expensive.

How else can the business benefit from such a small change? Let’s say you are from a large outsourcing company, let’s call it Malabar. At Malabar, everything is great: a lot of clients, a lot of developers, a big stack. But all the employees are used to using different technologies. Some like npm syntax, some like yarn, and some like pnpm.

Image description

So this third person from Malabar is sent on vacation. He’s flying to see Dubai. But the project can’t wait for him, someone has to replace the lucky guy. Another developer, who has always used NPM, is transferred to the project. He stumbles upon a new technology he has never worked with before. And then the fun part starts.

Problems may pop up at the moment of dependencies installation:

Image description

What to do? Replace the existing technology with another? Well, that’s one way out — it’s someone else’s project. What is the result? The developer has to spend extra time to study the new technology in order to start the tasks.

And it’s not just about package managers, it’s about the unification of different technologies within a company. If all projects use identical core technologies, onboarding will be reduced to a minimum. And that, by the way, is also a plus for business.

If you're interested same as me, you can continue reading on Medium.

Top comments (0)