You have reached the beginning of time!

Node.js 22 Features You Should Be Using

Node.js 22 has entered into Long-Term Support (LTS) phase, a critical milestone that signals its stability and readiness for enterprise-level deployment. This release represents a significant push toward dependency elimination, core performance optimization, and enhanced developer experience.

For production environments, achieving stability and performance is just the first step. True enterprise readiness requires superior visibility and control. This is where tools like N|Solid and N|Sentinel becomes indispensable. N|Solid offers deep insight into the Node.js runtime, allowing you to proactively monitor performance, manage memory, and squash memory leaks. Paired with N|Sentinel, you gain crucial security features and compliance measures that extend Node.js 22's inherent stability.

If your application isn't running on the new LTS, here are the production-ready features you're missing out on, and why you should prioritize the upgrade.

1. Stable WebSocket Client (via ws module)

Node.js 22 introduces a stable built-in WebSocket client, aligning it with the web platform standard. You can now create real-time connections without third-party libraries like ws or socket.io-client for basic use cases.

const ws = new WebSocket('wss://example.com');
ws.onmessage = (event) => console.log(event.data);

This feature reduces dependency bloat and makes it easier to write universal JavaScript that runs the same on the server and in the browser.

2. Built-in fetch() is Now Fully Stable

While fetch() was added in Node.js 18, it’s now fully stable and consistent with browser implementations. You can confidently replace packages like axios or node-fetch with the built-in API.

const res = await fetch('https://api.github.com');
const data = await res.json();

One less dependency, faster cold starts, and full alignment with the web standard API for HTTP requests.

3. Enhanced Permission Model

Node.js 22 continues to refine its permission model, first introduced as experimental in v20. You can now lock down file system, network, or environment variable access using flags:

node --experimental-permission \
     --allow-fs-read=/app/data \
     --allow-env=NODE_ENV index.js

It’s a major step toward runtime-level security — limiting what code can access even if a vulnerability exists in your dependencies.

4. Stable require() in ES Modules

Node.js 22 stabilizes the ability to use require() inside ES modules without complex workarounds. This means you can mix CommonJS and ESM seamlessly:

import { createRequire } from 'module';
const require = createRequire(import.meta.url);
const pkg = require('./package.json');

Makes hybrid migration paths much easier — especially for large enterprise codebases still transitioning to ES modules.

5. V8 12.4 — Performance and Language Upgrades

Node.js 22 ships with V8 12.4, bringing support for new ECMAScript features such as:

  • Array.prototype.with() and `Array.prototype.toSorted()
  • `RegExp v flag
  • Improved performance for object spread and optional chaining

New JavaScript capabilities make your code faster and cleaner without needing polyfills or transpilation.

6. Improved test Runner with Reporters and Coverage

The built-in Node.js test runner (node:test) now supports custom reporters, test coverage, and mock timers — giving you first-class testing capabilities out of the box.

import test from 'node:test';
import assert from 'node:assert';

test('basic math', () => {
  assert.strictEqual(2 + 2, 4);
});

You can now rely on the built-in test runner for both unit and integration tests — no external frameworks required.

7. Faster Startup Times and Memory Optimization

Several under-the-hood improvements reduce startup times and memory overhead, including optimizations in the module loader and the --inspect debugger.

Lower latency in cold starts (especially for serverless) and reduced memory footprint in containerized environments.

8. import.meta.resolve() Is Now Stable

You can now resolve module specifiers in ESM environments using the stable import.meta.resolve() method.

const path = await import.meta.resolve('lodash');
console.log(path);

This improves tooling, loaders, and dynamic imports — helpful for plugin-based architectures or custom module resolution.

9. WASI (WebAssembly System Interface) Improvements

Node.js 22 improves WASI support, allowing you to run WebAssembly modules with access to the file system, network, and more — securely and efficiently.

This expands Node.js beyond JavaScript, letting teams integrate compiled languages like Rust or C into production workloads.

10. New node --run Command

You can now run npm scripts directly through Node.js without using npm run:

node --run start

It’s faster, avoids spawning extra processes, and simplifies scripts in minimal environments like containers or CI/CD systems.

11. Better Diagnostics Channel Integration

Node.js 22 continues to strengthen diagnostic channels, making it easier for monitoring tools (like N|Solid) to hook into internal events for CPU profiling, heap snapshots, and async traces.

Production observability is more accessible and less intrusive — especially valuable for performance monitoring platforms.

12. Updated Intl APIs and Time Zone Handling

The Intl APIs now support custom calendars, numbering systems, and time zone updates based on the latest ICU version.

For global applications, this ensures accurate date, time, and number formatting across locales — critical for fintech, analytics, and reporting systems.

13. Native AbortController for All Asynchronous APIs

Abort signals are now supported across more native APIs, including file system and network operations:

const controller = new AbortController();
setTimeout(() => controller.abort(), 1000);
await fetch(url, { signal: controller.signal });

Improved resource management and cancellation make your applications more resilient under load.

14. Secure Default TLS Settings

Node.js 22 tightens default TLS configurations, enforcing stronger cryptographic standards and removing deprecated ciphers.

Your applications are more secure out of the box, reducing the need for manual SSL configuration in production.

15. Native EventTarget and AbortSignal Across Core APIs

More core modules now implement the Web-standard EventTarget and AbortSignal patterns, enabling consistent, browser-like APIs throughout Node.js.

This unification simplifies full-stack development — the same patterns work client and server side.

16. fs.cp and fs.mv Stability

The new file system methods for copying and moving files (fs.cp and fs.mv) are now fully stable, offering async and recursive behavior.

Simplifies file management tasks and removes the need for packages like fs-extra.

17. Stable Blob and File APIs

Blob, File, and related streaming APIs are now stable across Node.js core modules, improving interoperability with browsers and edge runtimes.

A step closer to “universal JavaScript” — one codebase running across client, server, and edge.

18. Updated URL and Encoding Utilities

Node.js 22 refines the URL, TextEncoder, and TextDecoder implementations for better spec compliance and performance.

Ensures consistent behavior for web APIs and faster parsing for large-scale data processing.

AI-Ready Observability with N|Solid and N|Sentinel

Modern Node.js applications need visibility. With Node.js 22’s improved diagnostic hooks, tools like N|Solid and N|Sentinel leverage these signals to detect anomalies, predict bottlenecks, and surface actionable insights through AI-powered analysis.

You can now pair the best of Node.js 22 with advanced runtime intelligence, ensuring your production environments stay secure, performant, and efficient.


Final Thoughts

Node.js 22 represents a major leap toward a more secure, standardized, and high-performance runtime. With so many features moving from experimental to stable, this version gives production teams fewer reasons to depend on third-party packages and more confidence to modernize their stack.

And when combined with N|Solid, you gain enterprise-grade observability, CPU and heap profiling, permission-level security insights, and AI-assisted recommendations through N|Sentinel, all designed to help you run Node.js 22 at its full potential in production.

The NodeSource platform offers a high-definition view of the performance, security and behavior of Node.js applications and functions.

Start for Free