Yarn v NPM, which is one is better

Yarn v NPM, which is one is better

My honest opinion of both.

I have been using NPM ever since I began coding back in 2017 and it was all knew, until recently (last year).

Experiences with NPM

When I was first introduced to programming, the language I was mostly using at the time was C# and create small console applications using Visual Studio 2015, found C# difficult and I went on my own journey of learning JavaScript and I stumbled upon NPM. I then went on to create a sorts of small and medium size projects with NPM.

What is NPM

There is a chance that someone might open this article and does not know what NPM is, let me explain it. NPM or Node Package Manager is a JavaScript package where a repo of tools software developers/engineers use to create applications or websites.

The first time I started using Yarn was yesterday, I have been asked a few times before as to why don't I use yarn, its just better when refactoring code, to be honest it was just me being lazy, and I have been playing around with yarn, and it is pretty similar to using NPM which is good.

What is Yarn

Yarn is similar to NPM but faster, Yarn was developed by Facebook (Meta).

Experiences with Yarn

When i started using Yarn, I was so surprised as to how easy it was to make use of it, I just created a folder and opened the folder using VS Code and popped up the terminal and just typed 'yarn init -y' and the package.json with the yarn lock file got installed, no in-depth research, just me playing around. I created a small react application, which generates quotes, instead of hard coding the quotes, I made use of an npm package called inspirational quotes, and of course I used 'yarn add' to install it ;D !.

The download speeds for some packages were fast, but it was considerably slower when I entered 'yarn create react-app .' in the command prompted.

My conclusion

Whether one is using yarn or npm, have your preference and stick with it, it does help to know about the other side of the coin, especially if one is being placed in a team environment.