javascript

What's New in Node.js 24

Damilola Olatunji

Damilola Olatunji on

What's New in Node.js 24

The latest Node.js release has arrived, and it's not just another incremental update. It delivers meaningful improvements that directly address real-world pain points and opens up new possibilities for JavaScript on the server.

In this article, we'll cut through the changelog noise and focus on what's genuinely worth getting excited about in this release.

Let's get started!

Built-in Test Runner Enhancements

In Node.js 24, the built-in test runner now intelligently manages test lifecycles without requiring explicit await statements for subtests.

This seemingly small improvement eliminates a major source of frustration and subtle bugs that plagued test suites in earlier versions.

Consider this common testing pattern:

JavaScript
import assert from "node:assert"; import { test } from "node:test"; import { setTimeout } from "node:timers/promises"; test("parent test", (t) => { t.test("first check", async (t) => { await setTimeout(1000); assert.strictEqual(2 + 2, 4); }); t.test("second check", (t) => { assert.strictEqual(1 + 1, 2); }); });

In Node.js 23 and earlier, this code fails with a cryptic "test did not finish before its parent and was cancelled" error:

subtests failing in Node.js 23 without explicit await

This forced developers to add explicit await statements before each subtest call:

JavaScript
test("parent test", async (t) => { // awaiting the sub test ensures proper execution await t.test("first check", async (t) => { await setTimeout(1000); assert.strictEqual(2 + 2, 4); }); await t.test("second check", (t) => { assert.strictEqual(1 + 1, 2); }); });

Node.js 24 now automatically detects and waits for subtests to complete, making your test code more concise and less prone to race conditions and timing errors.

This means the explicit await is no longer necessary and the tests will now pass without it:

subtests passing in Node.js 24 without explicit await

JavaScript Engine Enhancements

Node.js 24 ships with V8 13.6, which brings several new JavaScript language features, including escaping regular expressions, enhanced error handling, expanded WebAssembly capabilities, and compact floating point storage.

Escaping Regular Expressions

There's now a native method (RegExp.escape()) for safely escaping special characters in regular expressions. This allows you to dynamically insert user input or arbitrary strings into regex patterns without risking syntax errors or unexpected behavior:

JavaScript
console.log(RegExp.escape(`Escaping symbols like: .+*?()|[]{}^$`)); // Outputs: \x45scaping\x20symbols\x20like\x3a\x20\.\+\*\?\(\)\|\[\]\{\}\^\$

Enhanced Error Handling

Traditional error detection methods like instanceof break across realms (e.g., in Node.js vm contexts) and Object.toString() can be spoofed via Symbol.toStringTag(). The Error.isError() method has been introduced to properly identify Error instances regardless of their origin, allowing for more reliable debugging, error collection, serialization, and structured cloning operations.

You can use it as follows:

JavaScript
console.log(Error.isError(new Error())); // true console.log(Error.isError(new TypeError())); // true console.log( Error.isError({ name: "Error", message: "an error occurred new TypeError()", }) ); // false

Expanded WebAssembly Capabilities

In Node.js 24, support for 64-bit memory addressing (Memory64) has been added to WebAssembly, allowing applications to access more than the 4GB memory limit imposed by 32-bit pointers.

Memory64 enables WebAssembly modules to work with up to 16GB of memory, though this comes with a performance penalty, ranging from 10% to 100%+ slower than 32-bit mode.

This performance cost stems primarily from the requirement for explicit bounds to check on memory accesses, which can't be optimized away as they can in 32-bit WebAssembly through address space reservation techniques.

Compact Floating Point Storage

There's a new Float16Array typed array in Node.js 24 which offers significant memory efficiency benefits while maintaining reasonable precision for many use cases, such as machine learning models, graphics processing, and scientific computing, where memory footprint matters.

The URLPattern API Goes Global

The URLPattern constructor is now available globally, eliminating the need for explicit imports. This enables more intuitive handling of URL patterns:

JavaScript
// import { URLPattern } from 'node:url'; // This is not necessary in Node.js 24 // URLPattern is globally available const apiRoute = new URLPattern({ pathname: "/api/:resource/:id" }); const matches = apiRoute.test("https://example.com/api/users/123"); console.log(matches);

The Permission Model Loses Its Training Wheels

The permission model introduced as an experimental feature in Node.js 20 has matured significantly, and is no longer regarded as experimental. This has led to the command line flag being simplified from --experimental-permission to --permission.

This feature provides granular control over file system access, network connections, and other sensitive capabilities, allowing you to create more secure execution environments for Node.js applications.

Script failing without explicit permission

HTTP and Networking Upgrades

Node.js 24 includes Undici 7, which brings significant improvements to the HTTP client implementation. This upgrade includes:

  • Stricter compliance with the fetch() specification and the removal of third-party implementations of Blob, FormData, and AbortController.

  • Several pre-built interceptors for common tasks:

    • redirect: automatically follow HTTP 304 and Location headers.
    • retry: retry failed requests.
    • dump: dump the body of all requests.
    • dns: cache DNS lookups for an origin.
    • cache: cache HTTP responses according to the RFC 9111 standard.
  • A SQLite-based cache store for the cache interceptor which makes it possible to share cached HTTP responses with other Node.js processes.

  • New WebSocketStream implementation for streamable WebSocket connections.

  • A new responseError interceptor that replaces the throwOnError option.

For applications making extensive use of HTTP requests, these improvements should translate to better reliability and performance.

Turbocharged Context Tracking with AsyncContextFrame

Node.js 24 also updates the AsyncLocalStorage API with a new default underlying implementation called AsyncContextFrame which should deliver substantial performance gains for applications that track context across asynchronous operations (think request tracing, for example).

The upgrade doesn't just speed things up; it also strengthens reliability for complex async patterns and nested contexts where previous implementations could falter.

If you're building applications or monitoring systems that depend on consistent context propagation, this under-the-hood improvement might be the most impactful change in the entire release.

However, if your application specifically depends on the previous implementation's behavior, Node.js 24 provides the --no-async-context-frame flag to revert to the legacy async_hooks implementation.

NPM 11

The bundled npm package manager has been upgraded to version 11, featuring:

  • Support for node ^20.17.0 || >=22.9.0.
  • Improved performance when installing packages.
  • Enhanced vulnerability detection and security reporting.
  • The removal of the npm hook command.
  • A new type prompt when using npm init.
npm init now include type prompt

Deprecations and Removals

As part of the ongoing evolution of Node.js, several older APIs are being phased out:

  • The legacy URL parser (url.parse()) in favor of the more standards-compliant WHATWG URL API.
  • Various deprecated TLS methods like tls.createSecurePair().
  • Instantiating the REPLServer and Zlib classes without new.
  • SlowBuffer is deprecated in favour of Buffer.allocUnsafeSlow().

If you have any projects relying on these older interfaces, you'll need to plan migrations to their modern replacements.

You've Heard About Node.js 24, Now What?

This latest release brings some genuinely exciting improvements to the table and it also comes with a predictable support timeline you can plan around.

It now holds "Current" status until October 2025, when it will transition to Long-Term Support (LTS), signalling its readiness for production environments across the enterprise. From there, you'll benefit from active maintenance, security patches, and bug fixes until April 2028.

This timeline provides ample opportunity to begin progressive migration and compatibility testing while the development community addresses any early-stage issues.

To being experimenting with Node.js 24, I recommend using a version manager like Mise which makes it easy to use multiple Node.js versions on the same machine:

Shell
mise use -g node@24

Once installed, you can try the new language features and review your codebase to see where you've used deprecated functions. You should also consider experimenting with the permission model for security-sensitive applications.

For a complete breakdown of all the new features, bug fixes, and other changes, refer to the Node.js 24 official release notes.

If you're interested in getting involved with a future Node.js release, explore the open issues and contribution guidelines on GitHub.

Thanks for reading!

Wondering what you can do next?

Finished this article? Here are a few more things you can do:

  • Share this article on social media
Damilola Olatunji

Damilola Olatunji

Damilola is a freelance technical writer and software developer based in Lagos, Nigeria. He specializes in JavaScript and Node.js, and aims to deliver concise and practical articles for developers. When not writing or coding, he enjoys reading, playing games, and traveling.

All articles by Damilola Olatunji

Become our next author!

Find out more

AppSignal monitors your apps

AppSignal provides insights for Ruby, Rails, Elixir, Phoenix, Node.js, Express and many other frameworks and libraries. We are located in beautiful Amsterdam. We love stroopwafels. If you do too, let us know. We might send you some!

Discover AppSignal
AppSignal monitors your apps