Node.js – Features

Features of Node.js

1. Asynchronous occasion pushed IO helps concurrent request dealing with – That is in all probability the most important promoting factors of Node.js. This function principally means that if a request is acquired by Node for some Enter/Output operation, it should execute the operation within the background and proceed with processing different requests.

That is fairly totally different from different programming languages. A easy instance of that is given within the code beneath:-

var fs = require('fs');
fs.readFile("Sample.txt",function(error,data)
{
console.log("Reading Data completed");
});
  • The above code snippet appears to be like at studying a file known as Sample.txt. In different programming languages, the subsequent line of processing would solely occur as soon as your entire file is learn.
  • However within the case of Node.js the essential fraction of code to note is the declaration of the operate (‘operate(error,information)’). This is named a callback operate.
  • So what occurs right here is that the file studying operation will begin within thebackground. And different processing can occur concurrently whereas the file is being learn. As soon as the file learn operation is accomplished, this nameless operate might be referred to as and the textual content “Studying Information accomplished” might be written to the console log.

2. Node.js makes use of the V8 JavaScript Runtime engine, the one which is utilised by Google Chrome. Node has a wrapper over the JavaScript engine which makes the runtime engine a lot sooner and therefore processing of requests inside Node additionally grow to be sooner.

3. Dealing with of concurrent requests – One other key performance of Node is the means to deal with concurrent connections with a really minimal overhead on a single course of.

4. The Node.js library used JavaScript – That is one other vital side of growth in Node.js. A serious a part of the event neighbourhood are already effectively versed in javascript, and therefore, growth in Node.js turns into simpler for a developer who is aware of javascript.

5. There are an Lively and vibrant neighbourhood for the Node.js framework. Due to the energetic neighbourhood, there are at all times keys updates made obtainable to the framework. This helps to maintain the framework at all times up-to date with the most recent traits in internet growth

Read Also: Node.js – Handling Events