NodeJS 16 is officially released

Progamming Apr 22, 2021


NodeJS 16 was just released this week – it has added additional stable APIs to the popular JavaScript Runtime and even supports Apple Silicon. This release is the first to ship with binaries for Apple Silicon – they do provide separate tarballs for the Intel and ARM architectures. The macOS Installer will be shipped as a multi-architecture binary.

You can download the latest release from the current downloads page or use Node Version Manager on UNIX to install with nvm install 16. The NodeJS official blog also contains the changelogs of the newest version.

Version 16 will replace 15 as the current release line as per the version release schedule points out. For the next six months, will be the current release then promoted to the Long Term Support (LTS) in October of this year. Once it is promoted it will be designated as codename Gallium.

As a reminder — Node.js 12 will remain in long-term support until April 2022, and Node.js 14 will remain in long-term support until April 2023. Node.js 10 will go End-of-Life at the end of this month (April 2021). More details on our release plan/schedule can be found in the NodeJS Release Working Group repository.

Big Upgrade to V8 9.0

The newest version of the V8 JavaScript engine is bringing performance tweaks and improvements – while keeping NodeJS up to date with the JavaScript language features. In NodeJS 16, the V8 engine is updated to V8 9.0 — up from V8 8.6 in Node.js 15.

This update brings the ECMAScript RegExp Match Indices, which provide the start and end indices of the captured string. The indices array is available via the .indices property on match objects when the regular expression has the /d flag.

const matchObj = /(Java)(Script)/d.exec('JavaScript');
undefined

matchObj.indices
[ [ 0, 10 ], [ 0, 4 ], [ 4, 10 ], groups: undefined ]

matchObj.indices[0]; // Match
[ 0, 10 ]

matchObj.indices[1]; // First capture group
[ 0, 4 ]

matchObj.indices[2]; // Second capture group
[ 4, 10 ]

Stable Timers Promises API

The Timers Promises API provides an alternative set of timer functions that return Promise objects, removing the need to use util.promisify().

import { setTimeout } from 'timers/promises';

async function run() {
await setTimeout(5000);
console.log('Hello, World!');
}

run();

Other Features and Improvements

  • The Timers Promises API is stable, providing an alternative set of timer functions that return Promise objects, removing the need to use util.promisify().
  • The Google V8 9.0 JavaScript/WebAssembly engine serves as the underpinning of NodeJS 16, upgraded from V8 8.6 in NodeJS 15. The upgrade features the ECMAScript RegExp Match Indices, which provide the start and end indices of the captured string.
  • Features produced as part of recent NodeJS 15 releases that are now in NodeJS 16 include Node-API version 8, Stable Source Maps v3, and web platform atob (buffer.atob(data)) and btoa (buffer.btoa(data)) implementations for compatibility with legacy web platform APIs.
  • Notable deprecations include the runtime deprecation of access to process.binding() for several core modules, such as process.binding(‘http_parser’).

New compiler and platform minimums

Node.js provides pre-built binaries for several different platforms. For each major release, the minimum toolchains are assessed and raised where appropriate.

Node.js v16.0.0 will be the first release where we ship prebuilt binaries for Apple Silicon. While we’ll be providing separate tarballs for the Intel (darwin-x64) and ARM (darwin-arm64) architectures the macOS installer (.pkg) will be shipped as a ‘fat’ (multi-architecture) binary.

The production of these binaries was made possible thanks to the generosity of MacStadium donating the necessary hardware to the project.

On our Linux-based platforms, the minimum GCC level for building Node.js 16 will be GCC 8.3. Details about the supported toolchains and compilers are documented in the Node.js BUILDING.md file.

Deprecations

As a new major release, it’s also the time where we introduce new runtime deprecations. The Node.js project aims to minimize the disruption to the ecosystem for any breaking changes. The project uses a tool named CITGM (Canary in the Goldmine), to test the impact of any breaking changes (including deprecations) on a large number of the popular ecosystem modules to provide additional insight before landing these changes.

Notable deprecations in Node.js 16 include the runtime deprecation of access to process.binding() for a number of the core modules, such as process.binding(‘http_parser’).

Tags

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.