Why doesn't fetch in Node.js work out of the box? What's the best alternative? or How do I use fetch

14 Replies, 734 Views

Fun fact: Node didn’t include fetch because it was originally server-side, and browsers handled client-side stuff. Now the lines are blurred, but legacy code makes it hard to just add fetch in nodejs overnight.

For alternatives, I’d say:
- Axios if you want stability.
- undici if you want speed and future-proofing.
- got if you like streams and fancy features.

Pick your poison!

Messages In This Thread



Users browsing this thread: 1 Guest(s)