DEV Community

Cover image for Which Package Manager should I choose?
David (ダビッド ) for YggdrasilTS

Posted on

Which Package Manager should I choose?

Original Post

Package Manager is the backbone in every TypeScript/NodeJS project. There are several options to choose but, because of its popularity, npm, yarn or pnpm are the candidates.

In my experience, I have been switching between npm and yarn. The first choice was npm. It was the first package manager in the NodeJS ecosystem and it was the obligatory step if you started to do things with NodeJS.

Later, when yarn came to the playground, I changed to try it because I had read different articles with good impressions and I have to say it was mine as well.

After some time, and some npm improvements, I came back to npm, not without testing pnpm briefly before but, with not a good taste. At the beginning of this year, the yarn team released the version 2 but, unlike my previous try, this time I continued using npm, I am happy with it and it is not needed any package manager change in my projects.

I have made my decision and I have chosen npm but not everyone is choosing npm and if you want to share your projects with others developers, I think it is a good practice try not to force anybody to use your package manager selection so, I started to search some way to create projects with an agnostic package manager and I came across with npm-run-all library.

This library is able to run your run-scripts in different ways (serial, parallel) with no package manager indications, I mean, you can use npm, yarn or your favorite package manager with no worries about the other scripts execution.

Our Axiosfit library is using it and I encourage you to try it as well.

If you want to see a more complex sample, also you can check our TypeScript Full Stack project.

Enjoy!! 🌳

'INFO' Although it is true that there are some other tools like Gulp or Grunt to customize your run tasks, I like to be independent and only use my package manager scripts.

Top comments (3)

Collapse
 
victorioberra profile image
Victorio Berra

I have never left NPM because it's the one to most likely outlast all the newcomers. If we get lucky (which we have) npm, Inc will pour time and money into making NPM robust, fast, and secure. Plus it has always worked great, and some of the speed boosts we saw with Yarn was not a big enough incentive to leave the tool created by the same company who host the registry. Any time I see a big company release a new FOSS tool I err on the side of caution before I adopt. 90% of the time I end up not needing the tool because I am not google. also sometimes using and contributing to a FOSS tool that was released by a huge company might not be in the best interest of the open source community.

Collapse
 
telco2011 profile image
David (ダビッド )

Thanks for your comment.

I partially agree with you. I mean, I am very comfortable using npm in my projects and I hope to be using it for a long time but, I believe that having variety of tools to choose between them, it enrich our nodejs ecosystem.

I am very curious when I find a new tool and I like to test it and, if I find this tool it is better than the one I am using it, I try to adapt it. With yarn I did it but I prefer npm by now, like you I think ;-)

Thanks again for you opinion.

Collapse
 
victorioberra profile image
Victorio Berra

I believe that having variety of tools to choose between them, it enrich our nodejs ecosystem.

I wholeheartedly agree.