Node 8: Six New Features You must Know

A new version of Node.js is released which is Node 8. It came up with the new features that are true improvements to the LTS release line. These new features include as Ignition and TurboFan for V8 JavaScript Engine.

Node 8 will use V8 5.8 with ABI compatible with V8 6.0. This will provide better performance, a stronger support contract with V8 and a smaller delta between Node 8 and 9 as indicated by Node.js Collection. 


1. Async Hooks API- 

Async Hooks is a new experimental feature shipped with Node.js that goes deep into what a Node.js process is doing. It allows you to pull out a large amount of analytical information about that process. The Async Hooks (Formerly known as AsyncWrap) API got a notable upgrade to the latest version. This API enables you to get structural tracing information of the life of handle objects. The API emanates events that illuminate the customer about the life of all handle objects in Node.js. It attempts to settle comparable difficulties as the continuation-local-storage npm package, just in the core. Previously, a package called ‘co’ was used to utilize generators to write asynchronous code to create a more readable control flow. Now, this control flow can be implemented without the need of a third-party library. 

2. Buffer security improvements in Node 8-

There are 2 buffers, the first is zero filling Buffer and the second is a new Buffer. These both buffers are added by default. However, previously, the memory space was not initialized with zero. And hence one has to face  security issues because the Buffer instance had sensitive information. The upgrading with new version allows people to secure their privacy. However, it is advisable for the Node.js 8 users to first be aware of the risks involved in function and only then use to avoid the leakage of secure information. Though there is also a problem that you have to take performance hits. But it is good to process further with buffer.allocUnsafe (). 

3. TurboFan and Ignition-

With the new version of Node.js 8, you will find something entirely new V8 6.0. Here the, JavaScript runtime from Chromium that, by default powers the execution of JavaScript within Node.js. TurboFan and Ignition are the major updates to the internals of V8. It brings impressive performance gains with a variety of JavaScripts operations.

“The combined ignition and Turbofan pipeline have been in development for almost 3½ years. This shows the culmination of the collective insights that the V8 team has gleaned from measuring real-world JavaScript performance and carefully considering the shortcomings of Full-code gen and Crankshaft. It is a foundation with which we will be able to continue to optimize the entirety of the JavaScript language for years to come.”  

4. N-API-

This API will be the Application Binary Interface(ABI) stable with the versions of Node.js. This is proposed to protect Addons from changes in the hidden JavaScript engine. And it allows modules compiled for one version to run on later versions of NOde.js without any recompilation. The API is currently experimental. It is not depend on the underlying JavaScript runtime and is maintained as part of Node.js itself.

  • JS Binding for the Inspector– The new Inspector module allows developers to leverage the debug protocol. This tool is used by the Chrome inspector to inspect currently running JavaScript code. 
  • util.promisify()– This allows developers to wrap callback APIs to return Promises. The function works with little overhead and follows a standard API. 

5. HTTP/2-

It is a big update to Node.js which is carried out by Node.js 8 LTS. It came to function recently after exhaustive and long-term work driven by James Snell to discuss and make the difficult decisions about specific implementation details of HTTP/2 across the current HTTP implementation in Node.js core. The working path of HTTP/2 is different than the way Node.js developers have come to expect HTTP in Node to work. Hence there are some new and interesting workflows to learn.  

6. npm@5-

Formerly, Node.js 6 LTS came up with npm@3. This has brought some nice improvements to the previous versions. With the new Node.js 8 LTS, npm@5 brought some attractive features and performance. Some new features include lockfiles, local caching with offline fallbacks, SHA512 checksums and also a bunch of smaller features. In the context of performance, one can expect up to 5x performance increase in the best cases. In average you can expect 20-100% faster npm installs. 

For thorough study know the performance comparison between Node 6 and Node 8 at our blog- Upgrading from Node 6 to Node 8: performance comparison.

Final Words-

Node.js version 8 also came up with a lot of interesting improvements such as Async Hooks API which is little bit difficult to adapt with current state of its documentation. All the new features with Node.js 8 not only improves the performance but also efficiency. 

Are you looking for a web development to boost your business? Solace expert’s are well trained to use Node 8 for effective development. Our expert’s team will surely give you the best solution using new features of Node. Kindly Contact us for any software development using Node.

Related Post