10 useful features of Node.js

Useful features of Node.js

JavaScript is everywhere. After the Node.js, it expands its power to the servers. Node.js is an open source platform built on Chrome's JavaScript runtime for easily building fast and scalable network applications. It was invented in 2009 by Ryan Dahl.

Currently, Node.js gaining popularity worldwide, with coders everywhere using it to create APIs and build a new matrix of interoperability across the Internet. In this geek story, we’ll discuss about the 10 most useful features of Node.js. So, let’s start -

Extremely fast

Node.js is built on Google Chrome's V8 JavaScript Engine, which help its library to execute code very fast.

JSON has won

JSON is a practical, compound, most popular data exchange format. It is a key objective for Node.js coders, which enabled them to quickly construct APIs and foster interoperability at scale.

Asynchronous and event driven

All APIs of Node.js library are asynchronous, which mean it’s completely non-blocking. A Node.js based server never waits for an API to return data. It always moves to the next API after calling and a notification mechanism of Events of Node.js helps the server to get a response from the previous API call.

DevTools inspector integration

Node.js directly integrated to chrome devTools, which give you similar power like debugging front-end JavaScript. When you run Node.js with --inspect command-line argument, you will find chrome-devtools:// URL in the console. This URL will launch a remote debugging connection directly into the process, including features like - live code editing and full asynchronous call stacks.

Quick and safe temporary directory creation

The fs.mkdtemp() API was added to Node.js, which provide a guaranteed way to create a unique temporary directory. It generates six random characters to be appended behind a required directory prefix argument. It helps to integrate with system default temporary directories, and ensure that there won’t be directory conflicts.

Timing Attack Prevention

The crypto.timingSafeEqual() API helps to avoid timing attacks in Node.js. It allows comparison without leaking timing information about the comparison, which prevent from a malicious party to infer the values being compared.

Single threaded but highly scalable

Node.js uses a single threaded model with event looping. This event mechanism helps the server to respond in a non-blocking way and makes the server highly scalable as opposed to traditional servers which create limited threads to handle requests.

No buffering

Node.js applications never buffer any data. It cuts down the overall processing time while uploading audio and video files. The applications are simply output the data in chunks.

Process CPU usage

The process.cpuUsage() is a newly added API in Node.js, which returns an object that contains both user and system CPU time of the current process in microseconds. It helps to determine that how much time that the CPU was active by checking the total time difference in between two calls of the API.

Instrumentation

Node.js is well instrumented for production usage. There have tools to bring an application of full production readiness and performance.Though the Node.js is new technology in the market, still there have handful of documentation, tools, and best practices out there as like any other maturing technology.


 

Hope this article will help you to understand Node.js and its features for your future use. Thank you!

Recommended for you