in Js

Migrating from Npm to Yarn

Introduction

Both Npm & Yarn are package manager for the Node JavaScript platform. We are going to install yarn globally and see differences in command to npm.

Why yarn ?

Remember the time, when we used to download a package we want to use in a zipped version and extract them and using them . Then bower came , and npm rises. Well yarn is an improved package manager over npm. Yarn does not intend to replace npm but make improvement instead. yarn is faster and provides more features out of the box like offline packages install, parallel installation of packages and many others.

Getting Started

Open up your terminal and enter :

Now, you have yarn installed on your system. let’s take a look into some of the mostly used commands :

Using npm , installing all the dependencies we have in our package.json file.

Using yarn, which is equivalent to above command :

That’s it.  🙂

Installing a package :

is equivalent to

Uninstalling a package :

is equivalent to

Installing for development purpose :

Updating :

Initialization :

These are some of the mostly used commands in our development. Happy coding 🙂