Node.js 21 is now available!

Amir Mustafa
2 min readOct 18, 2023

The Node.js team announced the release of Node v21 yesterday.

Node.js 21 will replace Node.js 20 as our ‘Current’ release line when Node.js 20 enters long-term support (LTS) later this month.

As per the release schedule, Node.js 21 will be a ‘Current’ release for the next 6 months, until April 2024.

Notable Changes:

  1. Stable fetch/WebStreams —

→ Have updated fetch module including WebStreams.

→ This impacts WebStreams, FormData, Headers, Request, Response, and fetch.

const fetch = require("node-fetch");

fetch("https://example.com/api/data")
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));

2. V8 Engine Upgrade (V8 11.8) —

→ This is for performance improvements and some new features:

3. Streams

  • Optimizing Readable and Writable Streams

4. HTTP:

→ We can now create a single chunk for all calls to write() method.

res.cork();
res.write('Mozilla');
res.write(' Developer Network');
res.uncork();

and lots of performance fixes.

Commits:

Check out the complete commit by the Node.js team here.

Download and Release Updates:

Download: Node.JS 21

Release: Check out here to know more about the release.

Official Node.js Documentation:

→ I would recommend reading official docs for detailed updates here.

Conclusion:

Node.js has worked on various areas in the v21 release majorly in the V8 engine for performance, Web streams, strict mode enabled by default, streams, and so on.

As Node.js 16 LTS is retiring, we should plan for Node.js 20 LTS/ 18 LTS soon.

Thank you for reading till the end 🙌 . If you enjoyed this article or learned something new, support me by clicking the share button below to reach more people and/or give me a follow on Twitter and subscribe Happy Learnings !! to see some other tips, articles, and things I learn about and share there.

--

--

Amir Mustafa

JavaScript Specialist | Consultant | YouTuber 🎬. | AWS ☁️ | Docker 🐳 | Digital Nomad | Human. Connect with me on https://www.linkedin.com/in/amirmustafa1/