What is Node Js?

Node Js is a Javascript runtime environment, which is used to create servers. In simple words it is used to JS outside the web browser. It is built with the help of Google Chrome’s V8 engine.

Node Js is used to create data-intensive web applications or APIs as it uses the asynchronous methodology.

Why should we use Node JS?

  1. First of all, Node Js is based on JS, so you will definitely use JS for the frontend of your web applications. Using Node Js on the backend will help you to use the same JS on the backend as well (with some changes), so you don’t have to learn a different language for the backend.
  2. Node JS can easily handle the basic CRUD (Create Read Update Delete) operations on the web apps.
  3. We can send back dynamic content to the client and can also handle form submissions.
  4. Node Js supports all the HTTP methods like get, post, put, patch, delete and the list goes on.
  5. Using Node Js, you can also implement the authentication and authorization on your web apps.
  6. As Node Js is based on asynchronous methodology, its asynchronous nature eventually results in the better performance.
  7. You can connect Node Js to various databases like MySql, MongoDB etc.

Creating a basic server using Node JS

Code to create the server
Output

Leave a Reply

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