What’s New in Node 10

An overview of the Node.js v10 features

Version 10 is the newest release of Node.js, and it is packed with features. Going under the codename “Dubnium”, Node 10 was released April 24, 2018 and will enter Long Term Support (LTS) in October 2018. JavaScript developers have been excitedly awaiting today, so let’s take a look at the most notable features of this huge release.

Adding Error Codes

Errors in Node have now been standardized to have consistent codes with a repeatable pattern.

Errors have been a pain to work within the Node environment. Previously they only contained a string message with no other identifier associated. If a developer wanted the program to take actions based on a specific message, the only option was to do a string comparison of the error content.

Since error handling required exact string matching, even the smallest updates to messages could not be added until the next major Node release so that it would not break SemVer. By decoupling the error from the message, it will make them easier to work with for developers and allow Node to improve on error messages without introducing breaking changes. To learn more read Michael Dawson’s article Node error codes.

N-API is no longer experimental

The Node documentation describes N-API as an API for building native Addons. It is independent from the underlying JavaScript runtime (ex V8) and is maintained as part of Node.js itself. This API will be Application Binary Interface (ABI) stable across versions of Node.js. It is intended to insulate Addons from changes in the underlying JavaScript engine and allow modules compiled for one version to run on later versions of Node.js without recompilation.

N-API was experimentally introduced in Node 8 and is going to be to be stable beginning in Node 10. Upgrading between Node versions will no longer cause concern for module breakage. It will also be ported backward for Node.js v6.x and v8.x compatibility.

Native Node HTTP/2 becomes stable

An experimental HTTP/2 module was introduced in Node 8 which is a great upgrade for Node. HTTP/2 improves over the standard HTTP protocol

Multiplexing

Single Connection

Server Push

Prioritization

Header Compression

By leaving the experimental phase, a native HTTP/2 module will help improve Node servers and the web experience that they provide.

What’s New in Node 10

An overview of the Node.js v10 features

Version 10 is the newest release of Node.js, and it is packed with features. Going under the codename “Dubnium”, Node 10 was released April 24, 2018 and will enter Long Term Support (LTS) in October 2018. JavaScript developers have been excitedly awaiting today, so let’s take a look at the most notable features of this huge release.

Adding Error Codes

Errors in Node have now been standardized to have consistent codes with a repeatable pattern.

Errors have been a pain to work within the Node environment. Previously they only contained a string message with no other identifier associated. If a developer wanted the program to take actions based on a specific message, the only option was to do a string comparison of the error content.

Since error handling required exact string matching, even the smallest updates to messages could not be added until the next major Node release so that it would not break SemVer. By decoupling the error from the message, it will make them easier to work with for developers and allow Node to improve on error messages without introducing breaking changes. To learn more read Michael Dawson’s article Node error codes.

N-API is no longer experimental

The Node documentation describes N-API as an API for building native Addons. It is independent from the underlying JavaScript runtime (ex V8) and is maintained as part of Node.js itself. This API will be Application Binary Interface (ABI) stable across versions of Node.js. It is intended to insulate Addons from changes in the underlying JavaScript engine and allow modules compiled for one version to run on later versions of Node.js without recompilation.

N-API was experimentally introduced in Node 8 and is going to be to be stable beginning in Node 10. Upgrading between Node versions will no longer cause concern for module breakage. It will also be ported backward for Node.js v6.x and v8.x compatibility.

Native Node HTTP/2 becomes stable

An experimental HTTP/2 module was introduced in Node 8 which is a great upgrade for Node. HTTP/2 improves over the standard HTTP protocol

Multiplexing

Single Connection

Server Push

Prioritization

Header Compression

By leaving the experimental phase, a native HTTP/2 module will help improve Node servers and the web experience that they provide.