Node.js 23: Latest Updates and Improvements You Must Know

Dive into the innovations of Node.js 23, where enhanced performance, native ES module support, and robust security updates empower developers to create more efficient web and software applications.

nodejs latest updates and features

Node.js 23 has arrived, packed with exciting updates and powerful features for developers. This latest release brings a host of improvements that make Node.js faster, more efficient, and more versatile than ever before. For developers engaged in Node.js development, keeping up with these changes is crucial to maximising productivity and performance. In this post, we’ll dive into Node.js 23’s standout features, enhancements, and why it’s a game-changer for web and software development.

What Are the Updates in Node.js 23?

We’re excited to announce the release of Node.js 23! This version brings several impactful updates aimed at improving both developer experience and application performance. Here’s a look at the key highlights:

Node.js 23 will replace Node.js 22 as the “Current” release line once Node.js 22 enters Long-Term Support (LTS) later this month. This means Node.js 23 will be the Current release for the next six months, remaining so until April 2025. Below, we break down some of these key features in more detail.

Enabling require(esm) by Default

One of the most anticipated updates in Node.js 23 is the default enablement of native ES module support with require(). In earlier Node.js versions like v20.x and v22.x, this feature was only accessible through the –experimental-require-module flag. However, in Node.js 23, require(esm) is enabled by default, making it easier for developers to load ES modules natively without additional configuration.

How It Works:

When using require() to load an ES module in Node.js 23, the runtime no longer throws an error (ERR_REQUIRE_ESM) if the require() method encounters a native ES module. However, it may throw ERR_REQUIRE_ASYNC_MODULE if the module or any of its dependencies include top-level await statements. When successfully loaded, the ES module will return as a namespace object similar to the one provided by the import() statement. This object can be verified using util.isModuleNamespaceObject().

Key Notes on require(esm):

To check if require(esm) is enabled in your Node.js instance, you can use process.features.require_module. This feature is expected to simplify module management and make it easier for developers to work with both require() and import in the same project.

Removal of Windows 32-bit System Support

Node.js 23 has officially dropped support for 32-bit Windows systems. This update reflects a shift toward prioritising resources for 64-bit systems, which are more widely used and offer better performance. For developers working in software development on Windows, this change means that applications running on 32-bit Windows environments should either upgrade their operating systems or remain on an earlier Node.js version.

This decision allows the Node.js team to focus on optimising performance and security for the majority of users, ensuring that Node.js remains efficient and up-to-date.

Stabilisation of the node –run Command

The node –run command, introduced as an experimental feature in previous versions, has been stabilised in Node.js 23. This command streamlines script execution directly from the command line, making it more reliable for production use.

The –run flag improves workflows for developers by enabling quick execution of scripts without complex setups. Whether for testing, debugging, or deploying small applications, the stabilised node –run command simplifies common development tasks, particularly for teams focused on web development.

Enhanced Test Runner with Glob Pattern Support

Node.js 23 includes improvements to its built-in test runner, including support for glob patterns when specifying coverage files. This enhancement allows developers to specify multiple files or directories for test coverage in a single line, making the testing process more efficient and less prone to human error.

Example Usage of Glob Patterns: Using a glob pattern, you can specify multiple test files like this:

node test_runner –coverage ‘./tests/**/*.test.js’

This flexibility allows developers to include or exclude specific files and folders more easily, speeding up the testing process for projects with large codebases.

Deprecation of OpenSSL Engine-based APIs

Node.js 23 has deprecated the OpenSSL Engine-based APIs, which were used for extending cryptographic functions. This deprecation encourages developers to shift toward more secure, modern cryptographic methods. It’s a forward-looking decision aimed at enhancing security standards across Node.js applications.

Removal of Experimental Policy Feature

Node.js 23 has removed the experimental policy feature, which was previously used to control loading behaviour through policy files. This change simplifies Node.js’s feature set and refocuses the platform on stable, widely adopted configurations.

Platform Support Updates

Alongside the removal of support for Windows 32-bit, Node.js 23 has updated its platform support to align with current operating system trends. This update improves compatibility and performance on recent OS versions, enabling developers to take full advantage of newer technologies.

Web Storage API (Experimental)

Node.js 23 introduces an experimental Web Storage API, providing support for localStorage and sessionStorage in server environments. This addition brings web-like storage functionality to Node.js, allowing developers to use familiar storage techniques traditionally seen in front-end development. While still experimental, the Web Storage API holds potential for building applications that need simple data storage solutions without a database.

Experimental TypeScript Support

For the first time, Node.js 23 includes experimental TypeScript support, allowing developers to use TypeScript directly in Node.js without extra configuration. This update is a significant step toward making Node.js more TypeScript-friendly, appealing to the growing community of TypeScript developers and enabling smoother integration for type-safe applications.

Other Key Improvements in Node.js 23

Node.js 23 also includes a range of other enhancements that benefit both developers and businesses. Here are some additional highlights:

Benefits of Node.js 23 for Developers and Businesses

For companies and developers involved in software development, Node.js 23 offers several benefits that enhance both productivity and performance:

Node.js 23 also presents new possibilities for web development projects, enabling the creation of high-performing, real-time applications suited to the demands of today’s digital landscape.

Why Upgrade to Node.js 23?

Upgrading to Node.js 23 brings a range of benefits that help developers and companies stay competitive. From enhanced security and speed to innovative features like native ES module support, Node.js 23 offers tools that improve productivity and project outcomes. By leveraging these updates, teams can build scalable, secure applications with streamlined workflows and reduced infrastructure requirements.

Need help upgrading or developing with Node.js 23? Hire a Node.js developer from our team to implement these new features in your projects. As a top Node.js development company, EvinceDev ensures high-quality, future-ready solutions tailored to your business needs.

Exit mobile version