News for hackers. Stuff that matters.
Re:Fetch API has landed into Node.js by inglor on Tuesday February 01, 2022 @09:08AM (#30162563)
node-fetch (which is great btw!) implements fetch "reasonably" as in stuff like `fetch('./foo').then(x => x.json())` works but it's very far from a "real" fetch.

Some people argued users would still like it and there was an attempt[1] by Myles but at the end of the day - the changes were pretty big.

For example: a response body in fetch is a web stream (a whole new stream type) and to cancel you use an AbortController (web type) which is an EventTarget (another web type). `node-fetch` uses Node streams instead which is very reasonable but not something a platform can "get away" with while still calling it fetch.

Here is a comment I wrote about it in the tracker during the PR review process https://github.com/nodejs/node/pull/41749#issuecomment-10257...

[1](https://github.com/nodejs/node/pull/27979)

Re:Fetch API has landed into Node.js by dstroot on Tuesday February 01, 2022 @12:11PM (#30165701)
THANKS!