After the much-awaited release of the latest version of Node.js, Node.js 8.0 has been finally announced on 30th May after a month’s delay. Going by the codename ‘Carbon’, this version of Node.js will go into Long Term Support (LTS) in October 2017 and will be maintained till December 31st, 2019.
This major release of Node.js is claimed to have plenty of features that the developers are looking forward to testing. Here we go:
Features of Node.js 8.0
1. Async Hooks API:
The Async Hooks (formerly known as AsyncWrap) API has got a notable upgrade to the latest version. This API opens the way for developers to supervise the operation of the Node.js event loop, as well as allowing them to inspect the life of handle objects in the node.
Formerly, a package called ‘co’ was used to utilize generators to write better 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. Node.js API:
3. Buffer Changes:
Within Node.js, a number of vital changes have been done in the Buffer API. With this modification of the API, Buffers allocated using new Buffer(Number) or Buffer(Number) will be automatically filled with zeros. It will clearly have a remarkable effect on performance and prevent security issues as well.
4. TurboFan and Ignition:
The introduction of TurboFan and Ignition has been stated as the biggest change brought to Node.js. Version 8.0 comes with a simplified pipeline, without the FullCode Generator and the Crankshaft, enabling a lot of improvements which were impossible previously. This change was one one reasons of the delayed release of Node.js 8.0.
The Node.js application would crash due to the errors occurring while attempting to write console output to the underlying stream. But with version 8.0, such errors will be minimized, like suppressing the error events emitting when using console methods. This feature will also make the other APIs safer.
6. WHATWG URL Parser:
The fully supported version of WHATWG URL parser, which was added to Node.js 7.x last year as an experimental URL API, matches the URL implementation and API available in modern Web Browsers like Chrome, Firefox, Edge, and Safari. This new feature of version 8.0 allows code using URLs to be shared across environments.
Apart from these features that the brand new version of Node.js brought along, a few more special features are introduced to make the task of developers easier, such as, removal of deprecated fs.read() string interface, domain-aware Native Promise instances, and many more.
References: Risingstack, Nodejs, Codingsans, Sdtimes