NodeJS

NodeJS 23: Latest Updates and Features


Node.js 23 is finally here, with lots of updates and powerful features for developers. It brings along many improvements that have made Node.js faster, more efficient, and more versatile than ever. Keeping track of these changes by developers working on Node.js will be vital in maximizing productivity and performance. Let's explore some of the outstanding features and improvements brought about by Node.js 23 and what this means for web and software development.

What Are the Updates in Node.js 23?

We are excited to make available Node.js 23, with a number of high impact updates that benefit both developer experience and application performance. Here are the high level highlights:

  • Enabling require(esm) by Default: Native ES module loading using require() is now enabled by default.
  • Dropping Support for Windows 32-bit Systems: Node.js 23 no longer supports Windows 32-bit, streamlining focus on more widely used systems.
  • Stabilising the node –run Command: The run command has been stabilised, improving command-line functionality.
  • Enhanced Test Runner: New support for glob patterns in test runner coverage files enables more flexible testing options.

Enabling require(esm) by Default

One of the most significant updates in Node.js 23 is that by default, you can now use require() for native ES modules. In previous versions, you would need to use the --experimental-require-module flag, but in this version, it's baked right in. Therefore, working with ES modules becomes much easier without unnecessary steps. Keep in mind, however, that this is still an experimental feature. So if you run into some trouble, you can simply disable it with the --no-experimental-require-module flag.

This feature is now enabled by default, hence more accessible to integrate modern ES modules into Node.js applications. However, it is still in experimental phase and is a good step toward the full adoption to gather feedback before finalizing the feature.

If there are some regressions, the developers easily disable the feature with a –no-experimental-require-module flag to take enough time for adjustment and further improvement before more complete implementation.

Removal of Windows 32-bit System Support

Node.js 23 has removed support for 32-bit Windows environments. This release marks a phase where more efforts are directed to 64-bit systems, mainly because most applications are supported on these environments and work better on them. Software developers who operate on windows will, therefore, require their applications to either be upgraded to newer versions of Node.js or be left behind on the previous versions that support the earlier Node.js versions.

This decision will allow the Node.js team to focus on performance and security optimizations for the majority of users in the long run, keeping Node.js both efficient and current.

Stable node --run Command

Node 23 now presents a stable and efficient node --run command that assists the execution of scripts in package.json file without using npm. The use of a stable node --run command simplifies execution of common tasks such as deploying applications, running tests and building the project by running scripts easily.

There is a package.json file for your application like:

{“name”: ”demo-app”,“version”: “0.0.1”,“scripts”: {    “start”: “node demo.js”  }}

 

You can use the below command to start the application:

> node --run start

Experimental TypeScript Support

If you are a TypeScript developer, then Node.js 23 has something new for you: the --experimental-strip-types and --experimental-transform-types options. Experimental flags let you run TypeScript directly in Node.js, cutting down the steps needed to work with your TypeScript code. It's still early, but if you're experimenting with TypeScript, these options could make your life a lot easier.

Experimental Web Storage API

A few new updates in Node 23 are important implementation of APIs for sessionStorage and localStorage efforts towards further web compatibility. Developers will be allowed to store the data on the disk or for sessions with key/ value pairs through these features.

This feature also provides consistency across client and server environments because similar approaches are used across these environments. Methods such as setItem and getItem help in storing and retrieving data. They are more intuitive than cookies and helpful in managing user sessions.

Developers who are already familiar with using Web Storage functionality with other environments can now take advantage of it with Node.js and store data with this method, instead of cookies.

Summary

Node.js 23 is full of updates that make the developer experience better, including default support for ES modules with require(), new experimental tools like TypeScript support, Web Storage API and SQLite integration, along with stability improvements like the node --run command. These changes simplify workflows and make Node.js more powerful and versatile. The Node.js team encourages everyone to test these new capabilities and provide feedback, especially for experimental features, so they can keep refining them. 

 Ready to transform your business with our technology solutions? Contact Us today to Leverage Our NodeJS Expertise.

0

NodeJS

Related Center Of Excellence