Blog

Exploring the latest features in node.js 19

Exploring the latest features in node.js 19

New features in Node.js 19 include an updated V8 JavaScript engine to version 10.7 and the automatic activation of HTTP(s)/1.1 KeepAlive, as announced by the Node.js community.

The Node.js team published Node.js v19.0.0 on October 19, 2022, including improvements to the V8 JavaScript engine and other enhancements.

Node.js 19 is out in the wild and ready for download. Once Node.js 18 enters long-term support later this month, the newest version, Node.js 19, will take its position as the 'Current' release line. According to the official announcement made by the Node.js team, the version 19 of Node.js will be considered the "Current" release from now until April 2023.

Introduction to Node.js 19

You may now begin testing new features in Node.js 19 since it has been released. But, production deployments of Node.js 18 LTS may begin as early as October 25.

Every six months, a new version of Node.js is released. To allow library developers time to provide support for the new version, it will serve as the Current release for six months.

Releases with an odd number of digits, such as 19, lose support after six months, whereas versions with an even number of digits, such as 18, enter the Active LTS (long-term support) category and are suitable for widespread adoption

The standard 30 month support period after an LTS release is backed by the promise of significant bug fixes. Only the Active or Maintenance Long-Term Support (LTS) release should be used in production environments. On October 18, 2022, Node.js version 19 was released. It replaces the Previous version as the primary one.

Any Updates? Changes That Matter in Node.js 19

There were over 1,150 changes and fixes made since Node.js 18 to make this latest version, 19. There are fewer major new features this time around due to the fact that much of the development time was spent quietly fixing bugs and refining existing functionality. These are a few of the more intriguing options that may be used for Node.js development.

The node command with the —watch option (experimental)

If you have used nodemon before to speed up your development process, you will appreciate the new "—watch" command line option in Node.js 19.

Using this function, Node.js may be launched in a "watch" mode, which causes it to restart automatically whenever a file is changed.

It's worth noting that the two most popular operating systems for software development—Windows and macOS—are the only ones supported.

$ node —watch index.js

If you're using Node.js version 19 or later, you can take use of this function

Since it was part of the Node.js 18 release line before Node.js 19 was released, this serves as an example of how features swiftly return to older versions. Still, I felt the need to bring it up!

Safe Web Crypto

The latest, most reliable version of the WebCrypto API is now available in Node.js (with the exception of the following algorithms: Ed25519, Ed448, X25519, and X448)

If you want to use this feature, type the command into the box below.

globalThis.crypto or require('node:crypto').webcrypto

By default, HTTP(S)/1.1 uses KeepAlive.

By default, the keepAlive flag in this release of Node.js is enabled. This means all outgoing HTTP(s) connections will use HTTP 1.1 Keep-Alive by default. By default, the keep-alive interval is 5 seconds.

As a result of the automatic connection reuse that is enabled by keeping the connection alive, enable keep-alive to experience increased throughput.

Moreover, we can now decode any Keep-Alive messages the servers may send in response. This header informs the client of the maximum time it may maintain a connection

In contrast, the Node.js HTTP server will now instantly disconnect dormant clients when the close() function is used (who are utilizing HTTP Keep-Alive to reuse the connection).

By default, Node.js improves the throughput and speed of HTTP(S)/1.1 requests.

Alterations to the Default ESM Resolution

The —experimental-specifier-resolution option is deprecated in Node.js. By the use of tailored loaders, we are able to do this.

Lack of DTrace/SystemTap/ETW Support

You may use DTrace to see how much memory, CPU time, disk space, and network bandwidth are being consumed by each process currently active on your system

It's a great resource, but it takes a lot of effort to keep it up and running well. Due to this, DTrace/SystemTap/ETW is not supported by Node.js as of version 19.0.0.

The allocation of limited means is the primary culprit. The difficulty of continuing support for these instruments without a clear plan has shown to be unwarranted.

JavaScript Engine V8 was upgraded to version 10.7.

The V8 engine is the basis for Node.js. In a Node environment, your JavaScript code is interpreted and then executed.

With Node.js 19, you get the most recent version of the V8 JavaScript engine, which is 10.7. Our Node.js project just become a lot more powerful and up-to-date with the addition of JavaScript support

Since the V8 JavaScript engine provides the runtime environment that executes JavaScript code, programmers may create JavaScript without worrying about whether or not their code will run on Linux, Windows, macOS, or hardware powered by x64, Arm, or Power PC.

Although V8 is written in C++, it is the responsibility of Node.js developers to keep it updated and compatible with new hardware and OS releases.

Antl.NumberFormat is a brand new addition to the JavaScript API in this release.

To improve upon the functionality of the current Intl.NumberFormat, the TC39 has proposed a new version of the standard for Stage 3 of ECMA402, also named Intl.NumberFormat

As of version 8.1.0 of llhttp

The latest version of llhttp@8.1.0 is included in Node.js 19, which is available now.

In this effort, the http parser is being converted to TypeScript. It generates a C source file that may be linked and built using an embedder's application like Node.js.

uery and response parsing are both performed. The true intended purpose of the parser is in high-performance HTTP software.

The llhttp API and associated callbacks are under constant development by the Node.js development team

npm 8.19.2

Although both Node.js 18 and Node.js 19 feature NPM, the two versions are identical. Version 8.6.0 of the Node.js NPM package was released to the public. Thus, NPM is always current since it receives frequent updates

Provides a Mechanism

In contrast to its predecessor, Node.js 19 includes significant new features and improvements to the supported platforms. The requirements listed in BUILDING.md are unchanged, however support for unsupported operating systems has ended.

Conclusion

V8 JavaScript engine 10.7 feature, experimental node watch mode, and HTTP(S)/1.1 KeepAlive as defaults are just a few of the new and improved features included in Node.js 19. Until node.js 20 is published, this version is the most recent available.

About The Author

mds

Mr. Amit Gupta
Vice President – Sales

MetaDesign Solutions

Amit Gupta, Vice President - Sales, who adepts in Strategic Planning and Project Management with 18+years industrial cross-functional exposure. He is Engineer by professional who completed his graduate degree from Delhi College of Engineering. He is responsible for delineating the road map for all innovation, Sales activities at MetaDesign Solutions.

Get a Quote

Contact Us for your project estimation

We keep all information confidential and automatically agree to NDA.