Node.js 22 Adds WebSocket Client
Written by Ian Elliot   
Monday, 29 April 2024

Node.js 22 has been released with support for requiring ESM graphs, a stable WebSocket client, and updates of the V8 JavaScript engine.

Node.js is an open-source, cross-platform asynchronous event driven JavaScript runtime built on Chrome's JavaScript engine. It uses an event-driven, non-blocking I/O mode and executes JavaScript code outside web browsers.

nodejslogo

Node.js 22 is the "Current" release for the next six months, and Node.js 21 has now entered long-term support (LTS).

The first change of note is that support for require()ing ESM graphs is now exposed by default, and can be specified using a flag. This means that package authors now have a simple way to allow both CJS and ESM users to consume their packages.

The browser-compatible WebSocket client implementation has been included in a stable version, having been introduced in Node.js 21 as an experimental option.

A new mode --watch is available as a stable version in this release, having first appeared in version 18 as an experimental feature. This is a mode in which you can run your node server and it will reload when a change happens to the specified file or path.

The developers have increased the default highWaterMark for streams, and say this provides a performance boost across the board at the cost of slightly higher memory usage. Users in memory sensitive environments such as those developing apps for smart watches are "encouraged to monitor how this change will affect their environment", and the advice is that they should explicitly set setDefaultHighWaterMark.

Alongside a range of more minor changes, the V8 JavaScript engine has been updated to version 12.4, providing new features including WebAssembly Garbage Collection, Array.fromAsync, Set methods and iterator helpers. V8's Maglev Compiler is now enabled by default on supported architectures, which will improve performance for short-lived CLI programs. 

Node.js 22 is downloadable now.

nodejslogo

More Information

Node.js Foundation Homepage

Related Articles

Node.js 21 Has Stable WebStreams

Node.js 20 Adds Permission Module

Getting Started with Node.js

<ASIN:1871962579>

<ASIN:1871962560>

<ASIN:1871962625>

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Ruby On Rails Adds Kamal And Thruster Support
17/12/2024

Ruby on Rails 8 has been released. The new version comes preconfigured with Kamal 2 for application deployment, a new proxy called Thruster, and a trio of SQLite database-backed adapters named Solid C [ ... ]



GitHub Announces Free Copilot
19/12/2024

GitHub has launched GitHub Copilot Free, a free version of Copilot that provides limited access to selected features of Copilot and is automatically integrated into VS Code. The free tier is aimed at  [ ... ]


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Monday, 29 April 2024 )