Finally, after many discussions, opinions, and regular enthusiasm, the Node.js developers’ community launched the latest version of it Node20 on April 18, 2023. Following the event conventions, the community will promote the latest Node.js Long-term Support (LTS) version in October 2023. However, they have decided to run it till April 2026.
Now that the version is out for use, let’s get insights into its features and updates for a more precise understanding.
Newly added features and updates in Node 20:
Node20 has come up with numerous features and updates. The developers’ community has claimed it to be more precise to understand, faster in performance, and with highly effective error handling capabilities.
Here are some highlighted features and updates that made it more essential and effective for your next project.
1. Synchronous import.meta.resolve():
The import.meta.resolve function returns synchronously after aligning with the browser behavior. However, users can still define their loader resolve hooks as synchronous or asynchronous based on their preference.
Note: If asynchronous resolve hooks are loaded, the import.meta.resolve will return synchronously to the application code.
2. Stabilized Custom ESM Loader Hooks:
With a dedicated thread to run, the Custom hooks (–experimental-loader=./foo.mjs) supplied via loaders are now more stabilized than the previous version. It has been separated from the main thread delivering a different loader scope. Now, there will be no cross-contamination between application codes and loaders.
3. V8 Upgraded to 11.3:
A new and upgraded version of the V8 engine has been included in the Node.js 20, thanks to Michaël Zasso’s contributions. In Node.js 20, the V8 engine is update to version 11.3. Asa result, developers can now ensure high-end performance and new language features, such as:
- WebAssembly Tail Call
- RegExp v flag with set notation and numerous properties of strings
- Resizable ArrayBuffer + growable SharedArrayBuffer
- prototype.isWellFormed and toWellFormed
- Methods to change Array and TypedArray by copy
4. Stabilized Test Runner:
The test_runner modules in Node.js 19 were in the experimental stage. But in Node.js20, it has been updated and marked as stable. Thanks to the sheer contribution of Colin Ihrig, it is now ready for production use. However, some parts, like reporters and code coverage, still require some attention regarding stability.
5. Node.js Permission Model:
Node.js relies on the underlying operating system’s permissions model to enforce security, providing additional mechanisms to help secure applications. In this latest version, the “Permission Model.” has been re-furnished by Rafael Gonzaga. Now utilizing the advanced Permission Model, developers can avoid unwanted access/alteration of sensitive data in their applications.
6. Performance Improvements:
The Node.js developers team has brought significant performance enhancements to the latest Node.js 20. They have comprised various refinements to the essential parts of the runtime, including fetch(), URL, and EventTarget.
Moreover, they have reduced the cost to initiate Even Target, making it half. Also, fasten the access to all the subsystems using it. Best of all, the V8 Fast API calls have bettered its performance in APIs such as URL.canParse() and timers.
7. Ada 2.0 Included:
In Node.js 20, the URL parser is written in C++, resulting in Ada 2.0 inclusion. It means you will experience significant improvements in URL parsing performance. The upgrade in node: url boosts the url.domainToASCII and url.domainToUnicode functions.
8. Web Crypto API:
In Node.js 20, the constraint and validation of arguments of Web Crypto API functions according to their WebIDL definitions. These functions are identical to other implementations of the Web Crypto API, strengthening interoperability.
9. Official Assistance for ARM64 Windows:
ARM64 Windows has now been upgrade to tier 2 support, thanks to the inputs of Stefan Stojanovic. As a result, Node.js 20 now has the ARM64 Windows binaries, allowing native execution on the platform. Also, the CI system has been upgrade to facilitate full-fledged testing on ARM64 Windows, preventing regressions while ensuring compatibility.
10. Specified WASI Version:
The Node.js development team continued their experiment on improving WASI or Web Assembly System Interface implementation. In Node.js 20, there is no need for any command line to enable WASI, which means it is easier and quicker to consume now. Apart from this, multiple other changes took place in this segment to ensure its compatibility with future Node.js versions.
11. Deprecation & Removals:
The url.parse() in Node.js 20 has been deprecate at runtime with invalid ports. The url.parse() permits non-numeric port URLs, resulting in unexpected input and hostname spoofing. From now on to the next, any other Node.js version will come with a warning pop-up every time such URLs occur.
It’s not the end of the list. There were several more changes and updates Node.js 20 version has brought, such as:
- Faster startup time with enhanced performance
- Improved and agile support for TLS 1.3
- Inclusion of vital cryptography for secure communication
- Improved TypeScript support
- Better Error Handling
- Improved Debugging Experience
Discover more about the Node20 updates HERE!
These are some significant changes and updates that happened in Node20. This blog post has covered almost all the updates’ insights for your better understanding and consideration. If we forgot to mention any updates, please be proactive and kind to notify us in the comment box below.
Meanwhile, If you plan to develop your next web application using Node and are unsure about the version’s inclusion, enrich Metizsoft Solutions! We are a crowned Node.js Development Company with an impeccable track of delivering top-notch Node.js solutions. Hire Node.js Developers from us now!