Getting Started with Node.js
In this blog, we will try to understand the basics of Node.js, how it works, and why to choose Node.js, but before diving into node let's talk a little bit about Java-script.
What is Node.js?
Further, a package manager was introduced for the Node.js environment called node packet manager (NPM). The package manager makes it easier for programmers to publish and share the source code of Node.js packages and is designed to simplify the installation, updating, and uninstallation of packages.
How does Node.js work?
Node.js works in a Non-blocking or Asynchronous way. Let’s try to understand the Asynchronous architecture. Imagine you visited a restaurant, a waiter comes to your table and takes your order and gives it to the kitchen, and moves on to serve another table while the chef is preparing your meal. So the same person can serve many different tables, this is what we call non-blocking or asynchronous architecture and this is how node applications work, here the waiter is like a thread allocated to handle a request.
- It’s a light, scalable, and open-source language platform which makes it very easy to build apps.
- It uses a Non-blocking I/O approach, which lets us initiate parallel requests.
- Node has NPM (Node Package Manager) which contains libraries that can solve almost all the generic development problems and also makes the development process faster and more efficient.
In the next part of the blog, we will see what happens when we type a URL in the browser, further we will get into the basics of backend development using NodeJs.