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


Open Platform For Enterprise AI Launched
18/04/2024

A new platform aimed at building and supporting an open artificial intelligence (AI) and data community has been launched.  The Open Platform for Enterprise AI (OPEA) was announced by The Linux F [ ... ]



Pure Virtual C++ 2024 Sessions Announced
19/04/2024

Microsoft has announced the sessions for Pure Virtual C++ 2024, which is taking place on April 30th 15:00 UTC. People who sign up will get access to five sessions happening on the day, alongside a ran [ ... ]


More News

raspberry pi books

 

Comments




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

Last Updated ( Monday, 29 April 2024 )