Node.js 22 is Here: What's Changed in the World of Server-Side JavaScript
The Node.js team has officially released version 22, bringing a number of significant improvements and long-awaited features. The new version has been promoted to LTS (Long Term Support) status, making it recommended for production environments. Let's break down which innovations deserve special attention from developers.
V8 Engine 12.4 and Performance Improvements
One of the key upgrades is the update of the JavaScript engine V8 to version 12.4. This brought not only bug fixes but also a performance boost. In particular, memory management has been improved, and the execution of certain categories of scripts has been accelerated. Developers using heavy computations or high-load APIs will notice reduced response times.
Stable require() for ESM Modules
One of the most anticipated features is the ability to use require() to load ES modules (ESM). Previously, this required using dynamic import() or transpilation. Now you can write:
const lodash = require('lodash-es');This simplifies migrating projects from CommonJS to ESM and makes the code more uniform. It is especially valuable for large codebases where a gradual transition to the new standard modules was difficult.
Built-in WebSocket Client
Node.js 22 includes an experimental but already functional WebSocket client, implemented at the platform level. Now, for basic interaction with WebSocket servers, there is no need to install third-party libraries (such as ws). This reduces the number of dependencies in a project and speeds up the development of real-time applications (chats, notifications, streaming).
Other Important Changes
- Improved REPL — the interactive console now supports autocompletion for imported modules and command history.
- New methods in the glob API — support for
globSyncandglobStreamhas been added, simplifying work with file patterns. - Optimized Streams — the performance of
ReadableandWritablestreams has been improved, especially when working with large volumes of data. - Updated HTTP Client — bugs in the fetch API have been fixed, and error and timeout handling has been improved.
- Removal of Deprecated APIs — some deprecated functions have been finally removed, which may require updating legacy code.
What Does This Mean for Developers?
Upgrading to Node.js 22 is not just a version update, but a step towards a more unified and performant ecosystem. The stabilization of require() for ESM simplifies the maintenance of hybrid projects, and the built-in WebSocket lowers the entry barrier for real-time development. If you use Node.js in your projects, we strongly recommend starting to test the new version soon — especially if you work with modules, streams, or network protocols.
You can download Node.js 22 from the official website or through version managers (nvm, fnm). LTS support will last until April 2027 — this is an excellent reason to migrate.
Follow updates on PythonLib to be the first to know about news from the world of JavaScript and Node.js.