Node.js, npm, npx, yarn - huh?

npm basic nodejs javascript npx yarn
Node.js, npm, npx, yarn - huh?

Framework/Language: Node.js
Level: Beginners

What you will build/learn

This Codelab includes concepts/tools explanation and code snippets. To keep it simple, I have tried my best to explain things in the easiest way possible. Also, I have added some GIFs so that you can see those snippets in action.

Scope & Preferred for: 

This Codelab has been designed especially for those who are just beginning with Node and have some confusion about buzz words like npm, npx, node etc. 

Things you will learn

What is:

  • Node.js
  • NPM
  • Yarn 
  • NPX

Tools you will require

  • A computer/laptop with an internet connection. 



What is NodeJS?
Node.js explains itself as a JavaScript runtime built on Chrome's V8 JavaScript engine. Seems like magic spells from Harry Potter's world for one who is beginning with Node. So let's understand in easy language 😜

So Node is:
1- A JavaScript framework which helps you in writing backend. 
2- It uses V8 JS engine. JS engine is something which is responsible for running JS. Same engine chrome browser uses.
3- NodeJS is itself a framework but there are many frameworks built on top of NodeJS like Express, Restify, NestJS, LoopBack etc.
4- Supports almost every type of architecture like Serverless, Monolothic etc. 

Why Node.js?

1- Easy to Install.
2- Easy to understand syntax. 
3- JavaScript based. You can use same JS that you are using for frontend.
4- Works well with JSON.
5- Fast. Everyone uses Node for I/O operations.
6- Each cloud service supports. Widely used.
7- Larger community. 
8- No extra setup. One command to spin up a local development server.
and much more. Its just awesome.

How to install Node.js?
1- You can visit and click on Download.
2- Use nvm (Preferred). Explained in next step.