@whatwg-node/node-fetch
0.9.2 · 22 Oct 2026MIT8.8M / weekRepositoryHomepagenpmAtom feed
100 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 0.9.x · latest line
0.9.2
22 Oct 2026#3694
f927bd2Thanks @dependabot! - dependencies updates:#3715
06e7013Thanks @ardatan! - Fulfill pendingreader.read()as{ done: true }whencancel(reason)runs, matching the WHATWG ReadableStream cancel algorithm (and native undici).Previously
cancel()calledreadable.destroy()without ending the stream first, so an in-flightread()rejected withERR_STREAM_PREMATURE_CLOSE/Premature closeinstead of settling as done. The cancelreasonstill reachesunderlyingSource.cancel(reason).
0.9.1
30 Sep 2026#3642
ed29dc2Thanks @ardatan! - Follow the Fetch standard when the Node HTTP transport follows redirects.fetchNodeHttprecursed on every 3xxLocationwhileredirectwas'follow'(the default) and never counted hops. A response that always redirects could keep onefetchcall issuing requests until the process ran out of memory. Following now stops after 20 redirects. The promise rejects withTypeError: Fetch failed: Maximum number of redirects (20) reachedandcodeTooManyRedirects. A chain of 20 redirects that then returns a normal response still completes.That path also reused the previous request's
Headersobject for the next hop. A cross-originLocationtherefore receivedAuthorization,Proxy-Authorization,Cookie,Cookie2, and an explicitHost. Those headers are removed when the origin changes. The scheme is part of the origin, so anhttpstohttpredirect drops them too. Same-origin redirects still send them. Removal happens on a new header list, so the caller's ownHeadersobject is left unchanged.301and302responses toPOST, and303responses to any method other thanGETorHEAD, are resent asGETwith no body. The request-body headers go with the body:Content-Encoding,Content-Language,Content-Location,Content-Type, andContent-Length.307and308keep the method and body when that body can be sent again. A one-shot stream cannot, and that redirect rejects.A cross-origin redirect whose URL includes a username or password is rejected with
TypeErrorwhen the request mode iscors. Following it would send those URL credentials to the new origin asAuthorization.A resent
FormDatabody is encoded again with a new multipart boundary of the same length, so itsContent-Lengthstays valid.Content-Typeis replaced because that header names the boundary.redirect: 'error'rejects with aTypeError. A redirect whose target scheme is nothttporhttpsalso rejects with aTypeError.redirect: 'manual'still returns the redirect response.Response.redirect()serializes an absolute URL into theLocationheader and throwsTypeErrorwhen that URL cannot be parsed. A relative URL is stored as given, soResponse.redirect('/')setsLocationto/. The status must be301,302,303,307, or308; any other status throwsRangeError. The response status text is empty.@whatwg-node/fetchuses this transport on Node, so the same limits apply there.
0.9.0
21 Sep 20260.x packages: minor bump (breaking changes are allowed in minors while major is 0).
1.x packages (
@whatwg-node/promise-helpers,@whatwg-node/server-plugin-cookies): major bump, since dropping supported Node versions is a breaking engines change for SemVer>=1.0.0consumers.
Minor Changes
#3561
52a5bf6Thanks @ardatan! - Drop support for Node.js 18 and 20. The minimum supported Node.js version is now 22.15.
Why
Node.js 18 and 20 are end-of-life and no longer receive security updates. Keeping them in our support matrix forced version-specific workarounds and slowed adoption of newer Node TLS APIs.
The floor is set to 22.15 (not just 22.0) so we can rely on
tls.getCACertificates()(Node.js 22.15 / 23.10) and always-onzlibzstd helpers (createZstdCompress/createZstdDecompress, Node.js 22.15 / 23.8). That matches the oldest currently supported LTS line (22 Maintenance) while dropping only EOL majors.SemVer
0.x packages: minor bump (breaking changes are allowed in minors while major is 0).
1.x packages (
@whatwg-node/promise-helpers,@whatwg-node/server-plugin-cookies): major bump, since dropping supported Node versions is a breaking engines change for SemVer>=1.0.0consumers.
What changed
engines.node: all published packages now declare>=22.15.0(including@whatwg-node/promise-helpers, which was still on>=16).@whatwg-node/events: removed. NativeCustomEvent/Event/EventTargetare available on Node.js 22+, so the ponyfill is no longer maintained; use the platform globals.@whatwg-node/fetch: dropped therequire("crypto").webcryptofallback;cryptois alwaysglobalThis.cryptoon supported runtimes.@whatwg-node/server: removed the Node 18setHeadersworkaround (isNode1x);ServerResponse#setHeadersis used whenever it exists.@whatwg-node/node-fetch: Runtime guards forzlib.createZstdCompress/createZstdDecompressare removed;zstdis always included inAccept-Encoding.CI / e2e: unit matrix is
[22, 24, 26]; AWS Lambda runtime and Azure Function target moved from Node 20 to Node 22.
If you are still on Node 18 or 20, upgrade to Node.js 22.15+ (or 24 / 26) before installing this release.
#3604
b726b83Thanks @ardatan! - Drop the optionalnode-libcurldependency.The ponyfill HTTP transport now always uses
node:http/node:https. ThefetchCurlcode path and theglobalThis.libcurlruntime check have been removed.HTTP/2 support that previously came from
node-libcurlis no longer available in this release; a follow-up adds optional undici-based transport (including HTTP/2).If you were relying on
node-libcurlbeing picked up automatically, the ponyfill will now use the built-in Node.js HTTP stack instead.
Patch Changes
#3504
b4c83abThanks @ardatan! - Fix HTTPS verification for IPv6 address literals in the node-http ponyfill.Work around a Node.js regression (
tls.checkServerIdentity+domainToASCII) that rejects validIP AddressSANs for hosts like::1on Node.js 22.23+ / 24.17+ (#64032).The override is installed lazily on the first HTTPS request, and only when a one-time probe shows the running Node build is affected; healthy Node versions keep the built-in verifier.
#3612
f16ad4aThanks @ardatan! - Avoidstream/promises.pipelineinReadableStream.pipeTo/pipeThrough. The promise pipeline allocates and aborts anAbortControlleron teardown (expensiveDOMExceptionstack capture), which dominated cost for short TransformStream pipes such as request body size limiting. Use Node.pipe()with explicit error/finish handling instead, while still rejecting when the destination write fails.#3569
3f44041Thanks @ardatan! - MakeReadableStream.cancel(reason)resolve successfully instead of rejecting when waiting for close after destroy.#3012
3e55abcThanks @gmaclennan! - Destroy the Node response when the response body stream errors or is aborted, and propagateReadable.destroy(err)in the node-fetch stream ponyfill so piped sockets close with RST / ECONNRESET instead of hanging.Also make ponyfill
ReadableStream.pipeTo()reject when the destination write fails (after aborting the writer), instead of resolving successfully.
- 0.8.x
0.8.6
2 Jun 2026Reading the note…
0.8.5
6 Jan 2026Reading the note…
0.8.4
10 Nov 2025Reading the note…
0.8.3
10 Nov 2025Reading the note…
0.8.2
4 Nov 2025Reading the note…
0.8.1
9 Oct 2025Reading the note…
0.8.0
19 Sep 2025Reading the note…
- 0.7.x
0.7.25
1 Aug 2025Reading the note…
0.7.24
29 Jul 2025Reading the note…
0.7.23
28 Jul 2025Reading the note…
0.7.22
17 Jul 2025Reading the note…
0.7.21
20 May 2025Reading the note…
0.7.20
16 May 2025Reading the note…
0.7.19
10 May 2025Reading the note…
0.7.18
14 Apr 2025Reading the note…
0.7.17
25 Mar 2025Reading the note…
0.7.16
25 Mar 2025Reading the note…
0.7.15
25 Mar 2025Reading the note…
0.7.14
19 Mar 2025Reading the note…
0.7.13
17 Mar 2025Reading the note…
0.7.12
25 Feb 2025Reading the note…
0.7.11
24 Feb 2025Reading the note…
0.7.10
20 Feb 2025Reading the note…
0.7.9
13 Feb 2025Reading the note…
0.7.8
5 Feb 2025Reading the note…
0.7.7
10 Jan 2025Reading the note…
0.7.6
10 Jan 2025Reading the note…
0.7.5
10 Dec 2024Reading the note…
0.7.4
25 Nov 2024Reading the note…
0.7.3
19 Nov 2024Reading the note…
0.7.2
11 Nov 2024Reading the note…
0.7.1
9 Nov 2024Reading the note…
0.7.0
8 Nov 2024Reading the note…
- 0.6.x
0.6.0
4 Nov 2024Reading the note…
- 0.5.x
0.5.27
21 Oct 2024Reading the note…
0.5.26
1 Sep 2024Reading the note…
0.5.25
22 Aug 2024Reading the note…
0.5.24
21 Aug 2024Reading the note…
0.5.23
21 Aug 2024Reading the note…
0.5.22
14 Aug 2024Reading the note…
0.5.21
8 Aug 2024Reading the note…
0.5.20
30 Jul 2024Reading the note…
0.5.19
29 Jul 2024Reading the note…
0.5.18
26 Jul 2024Reading the note…
0.5.17
26 Jul 2024Reading the note…
0.5.16
26 Jul 2024Reading the note…
0.5.15
25 Jul 2024Reading the note…