Quick Summary

The Node.js core team is back with the latest version of the most renowned framework, Node.js 23. The 2024-released Node.js is power-packed with features and updates that will take the development experience and efficiency to the next level. In this blog post, we will take a brief look and dive deeper into exploring What’s New Node 23 and the new features and latest updates that the core team at Node.js has brought to us.

Table of Contents

Introduction

The Node.js team has officially announced the Node.js 23.0.0 version, marking a significant update with key advancements for developers. This time, the team has kept the official Node.js 23 release date of October 16, 2024. The latest version of Node.js 23 enlists many exciting new features, including enabling the use of require(esm) by default, improving testing tools, and removing support for 32-Windows systems. Here is a breakdown of the critical updates and their importance for the Node.js community.

What’s New in Node.js 23.0.0?

With the release of Node.js 23.0.0, the previous version, NodeJS 22, is set to enter LTS or long-term support later this month, and the latest version is set to replace it as the ‘Current’ release line.

? require(esm) Enabled by Default

The most significant change introduced with the Node.js 23 version is enabling the require(esm) by default. Previously, developers had to use the –experimental-require-module flag to load native ES modules through require().

Now, this feature is enabled by default, making it more accessible for integrating modern ES modules into Node.js applications. Though, it is still in the experimental phase, it is indeed a step towards the full adoption to gather feedback before finalizing the feature.

If there are any regressions, the developers can easily disable the feature using the –no-experimental-require-module flag, allowing time for adjustments and improvement before its more comprehensive implementation.

? Stable node --run Command

Next in line is another exciting addition: stabilization of the node –run command. This feature simplifies the execution of Node.js scripts directly from the terminal without explicitly defining a file or script, making the development workflows more flexible and efficient.

? Testing The Enhancements With The Glob Pattern Support

The NodeJS 23 version improves the inbuilt test runner, supporting glob pattern matching the coverage files. This enhancement simplifies running the tests across multiple files, enabling developers to quickly achieve more precise coverage reports.

? Experimental TypeScript Support

Node.js 23 introduces experimental TypeScript support, enabling developers to run TypeScript files with limited syntax transformation in Node.js directly. This removes the need for external transpilers, simplifying development workflows for TypeScript-based projects.

? Web Storage API (Experimental)

Another experimental addition is Web Storage API support. Developers can now use localStorage and sessionStorage in a Node.js environment, akin to how they are used in web browsers. This feature can be activated with the –experimental-webstorage flag.

? Deprecation of OpenSSL Engine-based APIs

OpenSSL 3 has deprecated support for custom engines, advising users to adopt its new provider model. As a result, the following Node.js options are impacted: clientCertEngine (used in https.request(), tls.createSecureContext(), and tls.createServer()), as well as privateKeyEngine and privateKeyIdentifier for tls.createSecureContext(), and crypto.setEngine().

? Removal of Experimental Policy Feature

The –experimental-policy option has been removed. Despite being tested for several years, fewer maintainers were available to support it, and recurring issues led to the decision to discontinue it, as further progress stalled.

? Platform Support Updates

In Node.js 23, the minimum required version for the GNU C/C++ compiler has been raised to gcc 12 to accommodate new C++20 features used in both Node.js and its dependencies, particularly V8. Additionally, support for 32-bit Windows has been dropped due to low usage, which no longer justified the resources needed to maintain it.

? Security Updates

Node.js 23 continues to emphasize security with numerous patches for vulnerabilities, including fixes for CVEs in core and third-party dependencies. The project also focuses on automating its security release process, aiming to make releases faster and more reliable.

Unlock the full potential of your projects with our industry-vetted Node.js experts

Hire NodeJS developers from us to upgrade your existing outdated NodeJS apps and ensure scalable and high-performance solutions!

Understanding require(esm) Default Behavior Better

Enabling the require(esm) allows your developers to load the native ES modules using the require() without facing the notorious ERR_REQUIRE_ESM error. However, the developers must consider that if an ES module or its dependencies use top-level await , Node.js will throw the ERR_REQUIRE_ASYNC_MODULE. To ensure a smooth integration, the developers can check if require(esm) is enabled using the process.features.require_module and detect compatibility via the “module-sync” export condition.

The said change is primarily important for modern JavaScript development, which allows the Node.js applications to integrate seamlessly with the broader JavaScript ecosystem that increasingly adopts the ES modules.

Additional Notable Changes in Node.js 23

  • Updated V8 Engine: The Node.js 23 includes the V8 updates (12.9.202), improving performance, memory handling, and compatibility with modern JavaScript features.
  • Removal of Deprecated CLI Flags: Several outdated flags, including –trace-atomics-wait and –no-experimental-global-customevent, have been deprecated and removed, keeping the Node.js lean and efficient.
  • Buffer Handling Enhancements: Changes to buffer operations now throw errors when writing beyond buffer capacity, improving reliability and reducing potential bugs.
  • Glob Matching for Test Coverage: The developers can efficiently utilize the glob patterns in their test coverage reports, making the testing across multiple files more straightforward and effective.
  • Updated Buffer Handling: New changes throw errors if writing beyond buffer capacity, making the buffer more reliable and reducing potential bugs.
  • Path Module Update: Added a matchGlob() method to handle glob pattern matching directly within paths, simplifying operations involving file patterns.
  • Improved Event Emitter: Enhancements to EventEmitter propagation and private fields to optimize event handling in asynchronous operations.
  • Deprecation of Old Utility Methods: Several outdated util methods like util.isPrimitive, util.isFunction, and util.isSymbol have been moved to end-of-life (EOL) status, encouraging developers to adopt more modern alternatives.

Preparing For Node.js 23.0.0

The Node.js 23.0.0 version brings aboard a number of new features with the other significant updates, it is recommended that developers thoroughly test their applications with Node.js 23 to ensure compatibility and use the new features and improvements.

For those maintaining legacy systems or requiring long-term stability, staying on Node.js 22 during the LTS may be a better choice. However, Node.js 23 offers many benefits for those looking to use modern features and performance enhancements.

Conclusion

The Node.js 23 release continues to push the tech stack forward, primarily with the streamlined handling of the ES modules and enhanced testing capabilities. While some developers need time to adjust to removing the 32-bit Windows support, the efficiency and ease of use make this Node 23 update an essential step for modern Node.js development and pave the path to the future of Node.js development. Make sure that you can explore the new features and consider how they can benefit from your workflows. If you are a business owner skeptical about making the call about whether you should upgrade your legacy applications to Node 23 or Node 22, leverage our Node.js Consulting Services. Our industry-vetted consultants will understand your requirements and guide you in making the right choice.

Upgrade to the latest Node.js 23 Version Today!

Our Node.js developers are experienced in transforming your legacy apps to the latest version.

Contact Us Now!

Build Your Agile Team

Hire Skilled Developer From Us

[email protected]

Your Success Is Guaranteed !

We accelerate the release of digital product and guaranteed their success

We Use Slack, Jira & GitHub for Accurate Deployment and Effective Communication.

How Can We Help You?