Node 18 Release - Top New Features
Node.js 18 is here and we are super excited to see it released on April 19th, 2022! Read through for a recap of the new features available in this latest release.
Node.js 18 Features Overview
We've been following this release for a few months now and documenting our analysis of some of the big new features. Here's a quick recap of those articles:
- fetch() API - fetch() is a promise-based client that supports many high-level HTTP features, while also focusing on the most common scenario: sending simplified HTTP requests. To those coming from the browser world, it is similar to XMLHttpRequest, but standardized and with an expanded and more flexible feature set.
- Test Runner (experimental) - A built-in testing module to Node core, behind an experimental flag for now. It will come in the form of a new
node:test
module that exposes an API for creating, and executing JavaScript tests. - Prefix-only core Modules - A new way to 'import' modules that levrages a 'node:' prefix which makes it immediately obvious that the modules are from Node.js core. Test runner is the first feature to use this in action!
- Direct Network Imports (experimental) - There will now be support for direct network imports, behind an experimental flag for now. This enables you to use HTTPS URLs to directly import modules over HTTPS into your project at run-time instead of relying on a package manager to install at build-time.
Other Notable Changes
- Webstreams API, Blob and BroadcastChannel have graduated out of experimental and are now available globally by default.
headersTimeout
andrequestTimeout
logic has been added to automatically close any open connections no longer needed.- The V8 engine is being updated to version 10.1. This new version includes the
findLast
andfindLastIndex
array methods, improvements to theIntl.Locale
API, TheIntl.supportedValuesOf
function and performance upgrades to the class fields and private class methods.
Notable misses
- The addition of a Command-line Argument Parsing API almost made it in to this release, but should be rolled out in the next minor release within the next few weeks.
For more details and a full commit list of what made it in, you can head over directly into the release PR for Node.js 18! A huge shoutout to Beth Griggs and the entire Node.js Release Working Group for making the entire process extremely organized and easy to follow.
Want More Node.js Updates?
At Stateful we build for developers like yourself and use lots of Node.js. As a result, we dedicate time to making sure we are active in the community and take deeper looks into any upcoming features. We also stay on top of other Node.js initiatives such as next-10 to get a sense of where the platform is headed.