DEV Community

Cover image for Most commonly used commands for NPM and YARN !
Amlan πŸš€
Amlan πŸš€

Posted on

Most commonly used commands for NPM and YARN !

Hello everyone! πŸ’™

In this article, we look into the commonly used package managers - NPM and YARN🀩 Probably you already know about these two package managers and have used them in your React JS projects or while building React JS or Node JS web apps. But you may often have been relying on a quick google search every now and then for the commands used differently by both the package managers! So here we explore the similar and different commands used by both package managers!

Let's get started !!

image.png

So what are NPM and YARN basically?

A package manager is a tool that automatically handles a project’s dependencies in a variety of ways. For example, with the help of a package manager, we can install, uninstall, update, and upgrade packages, configure project settings, run scripts, and so on. The package manager handles all of the heavy work, leaving us with only the coding which is the most enjoyable part.

NPM - It stands for Node Package Manager. This was released in 2010.
NPM involves a command-line interface (CLI) for interacting with npm via the terminal, the CLI tool. It ships as a default package manager with each fresh Node installation, which means we can start using it right away!

YARN - It stands for Yet Another Resource Negotiator, It is an alternative for npm.
It was released in 2016.
Yarn was created to address npm's shortcomings, such as performance and security concerns. It quickly established itself as a secure, speedy, and dependable JavaScript dependency management tool.

So what we get to know here is that package managers like NPM and Yarn make it easier to handle a project's dependencies.

image.png

So what are the commands which are * DIFFERENT * for both NPM and YARN?

What are they used for?

Let's look into this little sheet I prepared πŸ‘‡

Screenshot 2021-10-12 at 4.33.48 AM.png

So what are the commands which are SAME for both NPM and YARN?

Let's look at another sheet I prepared πŸ‘‡

Screenshot 2021-10-12 at 3.21.37 AM.png

So that's it for today! You have reached the end of the article 😁

Hope you liked this article and learned something and maybe it helped you remind the commands!

If you find this helpful please share and like it 😁 πŸ’™

image.png

Hi, I'm Amlan, a React Developer, and a CS Engineering student! This is my first blog article on DEV and I'm glad I finally decided to hop on the learning in public journey 😁

If you find this useful, please feel free to connect with me on any of the platforms below!

Twitter
LinkedIn

Top comments (2)

Collapse
 
pengeszikra profile image
Peter Vivo

I use yarn ( or npm ) day by day, and know the main difference, but never saw that essence, great post.

Collapse
 
amlandev10 profile image
Amlan πŸš€

Thank you !