124
Node.js 23: What’s New in The Latest Version?
08 Jan, 2025
7 min read
Table of Content
Node.js version 23.0.0 has been released, which is a significant improvement for developers. The version, released on October 16, 2024, introduced several new features. One of the standout changes is the default support for require(esm), making it easier to work with ECMAScript modules. This update simplifies module management and modernizes development workflows.
Hire Node.JS Developers to take full advantage of these enhancements and build scalable, high-performance applications.
The update also contains enhancements to testing tools, which is easily a valuable addition for developers. Furthermore, Node.js 23 removes support for 32-bit Windows, a deviation from modern platform trends. These changes aim to improve performance and streamline development processes within the Node.js community.
1. require(esm) Enabled by Default
Notably, the primary change in Node.js 23 is the auto-enablement of require(esm). Before this, developers required ES modules through require() using the –experimental-require-module flag.
This update means that developers can use require() to include native ES modules where they have not statically imported all modules and do not get the ERR_REQUIRE_ESM error in the process.
Although in the experimental stage now, this forms the basis for integrating newer ES modules into Node.js application environments. Happily, developers can disable the feature using the –no-experimental-require-module flag if necessary.
2. Stable node –run Command
Node.js 23 makes the node–run command more stable, which allows running Node.js scripts from the terminal directly. With this update, developers do not have to explicitly specify a file or script to run, and this makes development workflows faster and less rigid.
3. Testing Enhancements with Glob Pattern Support
A significant enhancement implemented in Node.js 23 is upgrading the built-in test runner to support glob patterns of coverage files. This means developers can run tests on multiple files and create more detailed and precise coverage reports without much effort.
4. Experimental TypeScript Support
Node.js 23 also introduced experimental support for TypeScript, where developers can run TypeScript files directly in Node.js without needing an external transpiler to transpile the TypeScript to JavaScript. This feature allows for a limited degree of syntax transformation, thereby making it possible for projects developed using TypeScript to run within the Node.js platform.
5. Web Storage API (Experimental)
The Web Storage API is now implemented in Node.js 23 as an experimental API. This addition allows the developer to employ the localStorage and sessionStorage features in Node.js rendering as in web browsers. Another advantage is while the developers can turn on this feature while using –experimental-webstorage flag.
6. Deprecation of OpenSSL Engine-based APIs
In OpenSSL 3 however, the concept of the custom engines has been deprecated. On Node.js 23, the new provider model has been suggested for adoption. Therefore, node.js options that are impacted by this change are clientCertEngine, privateKeyEngine and privateKeyIdentifier, used in https.request(), tls.createSecureContext(), tls.createServer().
7. Removal of Experimental Policy Feature
The experimental-policy option has been dropped from Node.js 23 and there are no maintainers – bugs occurred repeatedly. Nonetheless, the feature was under test for several years and was discontinued due to the lack of sufficient support and no advancement.
8. Platform Support Updates
In Node.js 23, the required GCC version was increased to 12 to address new C++20 additions employed in Node.js and its dependencies like V8. Furthermore, the support of Node.js has been withdrawn from 32-bit windows due to its low popularity and thus, could not be maintained any further.
9. Security Updates
Node.js 23 remains sensitive to security with patching impact noted to have addressed multiple issues such as CVEs affecting core and third-party libraries. It has also aimed at automating security release process for faster and more reliable security updates.
10. Understanding require(esm) Default Behavior
Using the require(esm) default option, developers can load the ES modules easily. However, if an ES module or its dependencies imports use top-level await, Node.js will throw an error with the code ERR_REQUIRE_ASYNC_MODULE. To see if require.esm is set, developers can use process.features.require_module, and for compatibility, the “module-sync” export condition can be used.
In conclusion, Node v23 incorporates some fascinating enhancements that heighten performance, security, and overall development efficacy, making the upgrade compulsory for both the old and new developers and teams.
In this case, key updates are the fresh V8 engine, an improved ECMAScript module synchronization, and better buffer management to achieve faster and more stable run-time. Moreover, Node.js Development Trends indicate a growing focus on scalability, real-time processing, and enhanced developer tools, which align perfectly with these upgrades. In addition to the simplified CLI flag options, these options are relevant to current standards, providing an environment conducive to development.
As Node.js grows stronger as one of the most flexible and high-performance platforms, decision-makers struggling to port legacy apps should seek professional advice. Therefore, our Node.js Consulting Services aim to provide you with the right information so that you can make the right choices for your business.
Node.js 23 introduces several notable features, including default support for loading native ES modules using require(), stabilization of the node –run command, and enhancements to the test runner with glob pattern support for coverage files. Additionally, it removes support for Windows 32-bit systems, focusing on modern, widely-used platforms.
This version enhances ECMAScript Modules (ESM) support by enabling require(esm) by default, allowing developers to load ES modules without additional flags. This change simplifies the integration of ESM into Node.js applications, improving compatibility and developer experience.
Performance improvements in Node.js 23 include optimizations in the V8 JavaScript engine, leading to faster code execution and better memory management. These enhancements result in quicker application startup times and more efficient resource utilization.
Node.js 23 also includes security improvements, such as enhanced support for HTTP/2 and HTTP/3, providing more secure connections for web applications. Additionally, the deprecation of legacy features encourages the adoption of more secure and efficient alternatives.
Development
Mobile Apps
8184
By Devik Gondaliya
07 Jan, 2025
Artificial Intelligence (AI)
Development
310
By Biztech
06 Jan, 2025
Magento
379
By Devik Gondaliya
31 Dec, 2024