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


Raspberry Pi To Go Public - Are We Worried?
22/05/2024

Raspberry Pi used to be the enthusiast's enthusiasm and this provided a base to expand into commercial applications. For some time now, some of the enthusiasts have been expressing concern that the co [ ... ]



Stack Overflow Jobs Reborn In Partnership With Indeed
13/05/2024

Stack Overflow has launched a new jobs site co-branded with Indeed. It is intended to make thousands of highly-relevant job openings easily discoverable by developers. The job site is curren [ ... ]


More News

raspberry pi books

 

Comments




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

Last Updated ( Monday, 29 April 2024 )