The release of Node.js 21 is available now. Now Node.js 21 will replaces Node.js 20 as our current release line, and Node.js 20 is being promoted to LTS (long-term support).
Now, let's see what is the difference between the two releases?
Node.js 20 LTS is best for production deployments, whereas Node.js 21 is suitable for early feature testing for your own unique environment. Node.js 21 will be the 'Current' release for the following six months, or until April 2024.
Highlights of Node.js 21 include changes to the V8 JavaScript engine to version 11.8, stable WebStreams, a brand-new experimental flag to flip module defaults (-experimental-default-type), several enhancements to our test runner, and more!
"If you’re interested in getting access into interesting new features early then Node.js 21 is a great way to test and see what’s coming. This NodeJS release schedule specifically covers this. And if you are already in active deployment or if you are planning for it, then Node.js 20 and 18 LTS are for you." said Rafael Gonzaga, Node.js Technical Steering Committee (TSC) Member. “Many thanks to our open source contributors for making Node.js better and better. Thanks also to OpenSSF and Project Alpha Omega for helping us improve Node.js security.”
The demand for Node.js among developers continues to grow as the demand for reliable and scalable web applications grows.
You can immediately assess the state of Node.js features with Node.js 21," stated Michal Zasso, a member of the Node.js TSC. "Node.js has had a reliable test runner since Node.js version 20. There is no need to install any third-party module, you can create test scripts easily. Node.js 21 includes many improvements to the test runner. Try it out!
Main updates for Node.js 21
- The V8 JavaScript engine is updated to 11.8
- Stable WebStreams, which helps with data processing in small quantities for browser applications
- A new experimental flag to flip module defaults (–experimental-default-type) – Node.js has two module systems: CommonJS modules and ECMAScript modules. Node.js treats files with a .js extension by default as CommonJS modules. This can now more easily be flipped.
- Many improvements have been made to test runners, allowing users to conduct functional tests and export data.
Also Read: What is NodeJS and Its Features
NodeJS 21 Features
- Fetch and WebStreams APIs promoted to stable.
- The V8 JavaScript engine and npm are updated.
- NodeJS 21 contains latest version of V8 JavaScript engine and npm 10.2.
- Also many improvements are done in to the test runner.
Download Node.js 21 from here and get started testing right away! You can also read more details on Node.js blog.