Is it really worth switching to Yarn from NPM

Rahul Bhooteshwar
Learn With Rahul
Published in
2 min readAug 26, 2017

There is a new dependency manager that is claimed to be a Fast alternative to your favourite but “slow” dependency manager NPM (not true for latest version)

Before we dive into the NPM VS Yarn discussion, let’s take a look about what Yarn is ?

Yarn is claimed to be FAST, RELIABLE, AND SECURE DEPENDENCY MANAGER. Yarn is another package manager in competition with NPM.

In response to the claims of Yarn, NPM 5 has added some features that are worth noticing. Performance of NPM 5 is far better (20% to 100%) from its earlier versions.

Yarn is developed and promoted by Facebook and claimed to overcome performance issues of NPM dependency manager.

It is also worth noticing that it will take you almost nothing to switch from using NPM to Yarn as dependency manager for your existing projects. As we are not here to discuss how to use Yarn, lets focus on the main thing , “Is it worth switching to Yarn from NPM

So, to compare the key feature, that is performance I used Yarn and NPM 5 for the same package.json file (for a basic Angular-CLI project), and results are as following:

NPM 5 VS Yarn module installation time

NPM 5 also supports a package-lock.json file in response to Yarn’s yarn.lock file. NPM 5 provides a self healing cache, so no need to run npm cache clean now.

It is not Yarn vs NPM!! I just wanted to clarify if it is worth having a look at your package dependency manager?

So to conclude, you can enjoy having your current dependency manager in place but with an upgrade that is NPM 5.

The analysis I did is still in starting phase, but results are quite surprising. Results may vary depending on the number of dependencies in your package.json file.

I hope this will help you understanding the NPM vs Yarn debate trending in dependency management world.

Will be back with some amazing things. Till then ..Keep Learning .. Keep yourself updated.

--

--

Rahul Bhooteshwar
Learn With Rahul

Programming enthusiast, Technical Blogger, learning the concepts of cutting-edge technologies in Software Development.