What is Node.js?

nodejs-logo

In this blog, you will learn all about node.js. Also, you will learn:

  1. What is Node.js?
  2. Why should I use Node.js?
  3. What does Node.js be capable of doing?
  4. What is Node.js file?

Let’s start now and understand the first step.

What is Node.js?

Node.js is an open-source server environment that is built on Google chrome’s javascript(JS) engine(v8 Engine). Ryan Dahl developed this server-side platform in 2009. This is basically developed for easily building fast and scalable network applications. Node.js is lightweight and efficient because it uses an event-driven, non-blocking i/o model, it is perfect for data-intensive real-time applications that run across distributed devices.

It can also runs on various platforms like linux, windows, mac os, etc. and it uses JavaScript on the server.

NODE.JS = RUNTIME ENVIRONMENT + JAVASCRIPT LIBRARY

WHY SHOULD I USE NODE.JS?

To clarify this let’s take a simple example for a web browser to open a file on the server and to return the content to the client. With this example let’s see how does the PHP/ASP and Node.js handles a file request.

PHP or ASP handles the file request in this way:

  1. It sends the task to the computer’s file system,
  2. It waits during the file system opens and read the file,
  3. Then it returns the content to the client,
  4. Now it is ready to handle the new request.

and Node.js handles the file request in this way:

  1. It sends the task to the computer’s file system,
  2. Now it is ready to handle the new request,
  3. When the file is opened and it is read by the file system, then the server returns the content to the client.

From the above comparison you may have understood that Node.js eliminates the waiting time and continues to the next request without delaying. because of this reason Node.js applications never buffer any data. So simply these applications output the data in chunks.

Node.js runs single-threaded, asynchronously programming, non-blocking, which makes it memory efficient.

What does Node.js BE capable of doing?

Here are few points that Node.js is capable of doing:

  1. Node.js is capable of generating dynamic page content.
  2. Node.js is capable of creating, reading, opening, deleting and closing the files on the server.
  3. Node.js is capable of collecting the form data.
  4. Node.js is capable of adding, deleting, modifying the data into your database.

What is Node.js file?

Here is a short description about the Node.js file,

  1. Node.js files contain those tasks that can be executed on certain events.
  2. A typical event is someone who is trying to access a port on to the server.
  3. You have to initiate your Node.js files on the server if you want to have any effect.
  4. Extention of node.js files are “.js”.

This is all about the node.js, I hope you have gained some good quality of knowledge from here. If you have any query then feel free to leave your query below in the comment section.

Stay tuned and Happy Learning. 🙂

One thought on “What is Node.js?

Leave a Reply

Your email address will not be published. Required fields are marked *