Node.js 22 Released: Overview of Major Innovations and Changes
The JavaScript developer community has welcomed an important event — the official release of Node.js 22. This version brings numerous improvements that will affect both backend developers and creators of command-line tools. Let's break down the most significant changes that everyone working with Node.js should know.
V8 Engine 12.4: Speed and New Features
The heart of Node.js 22 is the updated V8 engine version 12.4. This is not just a cosmetic upgrade — it brings new JavaScript features that can already be used in production:
- Array.fromAsync — a static method for asynchronously creating arrays from iterable objects. Simplifies working with data streams.
- Set methods — direct calls to
intersection(),union(),difference()for working with sets without third-party libraries. - Iterator Helpers — long-awaited methods for working with iterators (map, filter, take, and others) are now available "out of the box".
Stable require() for ESM Modules
One of the most discussed changes — the --experimental-require-module flag is now enabled by default. This means you can use require() to load ESM modules (with .mjs extension or with "type": "module" in package.json).
What this means for the developer:
- Gradual transition from CommonJS to ESM without rewriting all code.
- Ability to include modern ESM packages in older projects.
- Simplified migration for large codebases.
Improved WebSocket and Network Operations
Node.js 22 includes a built-in WebSocket client (previously experimental). Now, to create real-time applications, you don't need to install ws or socket.io — everything is available through the global WebSocket object.
Also worth noting are improvements in the HTTP client: HTTP/2 support is enabled by default, and there is now the ability to use fetch() with automatic proxy detection from environment variables.
Changes in File System Operations
Developers working with files will appreciate the new methods in the fs module:
- fs.cp — now stable and works faster than alternatives.
- fs.openAsBlob() — creating a Blob from a file without loading it entirely into memory.
- Improved support for symbolic links on Windows.
What is Deprecated and Removed
As with any major update, some features have been marked as deprecated or removed:
- The
punycodemodule has been completely removed (useURLor thepunycodepackage from npm). - The command-line arguments
--experimental-loaderand--experimental-specifier-resolutionhave been declared deprecated. - The
--no-experimental-fetchoption no longer works — fetch is now permanently built-in.
How to Update
Node.js 22 is available for download on the official website nodejs.org. It is recommended to update via a version manager (nvm or fnm) so you can quickly roll back if necessary.