2 min read

Today, the team behind Node.js announced the release of Node.js 12 with new updates and features including faster startup and better default heap limits, updates to V8, and much more. This release replaces version 11 in the current release line. With the release of version 12,  Node.js release line will soon become Node.js Long Term Support (LTS) which will release in Oct 2019

What’s new in Node.js 12?

V8 Javascript engine v7.4

A new version of the V8 JavaScript engine comes with improved performance, language, and runtime. The team has added a new feature called zero-cost async stack traces, that improves the error.stack property with asynchronous call frames.  With V8 v7.4, there are faster calls with arguments mismatch. Even the JavaScript parsing has got faster.

TLS 1.3

This version of Node.js comes with TLS1.3 (Transport Layer Security) support which is now the default max protocol. This release also supports CLI/NODE_OPTIONS switches in order to disable it, if required.

Configure default heap limits

With Node.js 12 release, the JavaScript heap size is configured based on available memory instead of using defaults which were set by V8 for use with browsers. Now with the help of this configuration, Node.js won’t try to use more memory than is available and would terminate when its memory is exhausted. This feature is highly useful while processing large data-sets.

Switch default http parser to llhttp

This release will also switch the default parser to llhttp which will be beneficial to make testing and comparing the new llhttp-based implementation easier.  

Making native modules get easier

Node.js 12 makes building and supporting native modules easier. The new changes include better support for native modules in combination with Worker threads. Users can now use their own threads for native asynchronous functions.

Worker threads

In this release, the worker threads don’t require the use of a flag. With this release, additional threads can be leveraged whenever required for better results.

Diagnostic reports

Node.js 12 comes with a new experimental feature called diagnostic report which allows the users to generate a report on demand. The report contains information that can be useful for diagnosing problems in production including crashes, high CPU usage, slow performance, memory leaks, unexpected errors and more.

Read Next

Google is planning to bring Node.js support to Fuchsia

Node.js and JS Foundations are now merged into the OpenJS Foundation

7 Best Practices for Logging in Node.js