Node.js 17.5 Brings Built‑in Fetch API: What Developers Need to Know

Node.js v17.5 introduces experimental support for the familiar fetch API—originally a browser‑side HTTP client—by leveraging the Undici library, allowing developers to use a lightweight, standards‑compliant request method without external modules, though it still requires the --experimental-fetch flag to activate.

Node Underground
Node Underground
Node Underground
Node.js 17.5 Brings Built‑in Fetch API: What Developers Need to Know

Node.js v17.5 adds experimental support for the fetch API, a widely used cross‑platform HTTP client in front‑end development that runs in browsers and service workers. This brings a familiar interface to the server side.

fetch support illustration
fetch support illustration

The previous built‑in http module exposed many private APIs, leading many community HTTP clients to rely on them, which hindered rapid iteration and new features. To address this, the Undici library was created as a fast, reliable, standards‑compliant HTTP/1.1 client.

The new fetch implementation in Node.js is built on Undici, allowing the core to integrate this functionality and potentially replace the older http request mechanisms over time.

To use the built‑in fetch, start Node.js with the --experimental-fetch flag. While the feature is lightweight and simple, it remains experimental and may take time before it becomes the default.

Node.jsHTTPexperimental featureFetch APIUndici
Node Underground
Written by

Node Underground

No language is immortal—Node.js isn’t either—but thoughtful reflection is priceless. This underground community for Node.js enthusiasts was started by Taobao’s Front‑End Team (FED) to share our original insights and viewpoints from working with Node.js. Follow us. BTW, we’re hiring.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.