Know Yarn Before Learning Node.js

Elye - A One Eye Developer
Level Up Coding
Published in
3 min readNov 29, 2019

--

Picture by Tara Evans on Unsplash

I wanted to learn Node.js because I’ve heard it is so simple to set it up as a server. Like anyone else, I start by doing a search for “Node.js Tutorial” on Google. I frankly have to say the tutorial material found is all superb.

However, they miss mentioning something that’s so popular in the community today: Yarn.

What is Yarn?

It is a Dependency Management tool we can use for many things, such as Node.js, React, etc.

Its predecessor (or maybe rival) is npm. They are supposed to be able to do the same thing. It was claimed that yarn is more reliable and faster, but npm has caught up.

Can I still use npm?

Yes, you can. It’s still functioning. In fact all the Node.js tutorials I saw still refer to it as the tool to use to download a 3rd party package module.

Nonetheless, as a new user, after learning yarn, I prefer it over npm for setting up a new project.

Why I prefer yarn?

I realized to use npm properly, we should set up the package.json file accordingly. This can be done by using the command npm init. (Note: not all Node.js tutorials tell you that).

The use of package.json

--

--