logoalt Hacker News

afavourtoday at 11:58 AM8 repliesview on HN

Irony is that Node has no need for Axios, native fetch support has been there for years, so in terms of network requests it is batteries included.


Replies

fishpen0today at 5:35 PM

It doesn't matter. We pulled axios out of our codebase, but it still ends up in there as a child or peer from 40 other dependencies. Many from major vendors like datadog, slack, twilio, nx (in the gcs-cache extension), etc...

pier25today at 1:12 PM

People use axios or ky because with fetch you inevitably end up writing a small wrapper on top of it anyway.

show 3 replies
zadikiantoday at 4:27 PM

Node fetch is relatively new. Wasn't marked stable until 2023, though I've used it since like 2018.

cyco130today at 1:32 PM

I'm not sure fetch is a good server-side API. The typical fetch-based code snippet `fetch(API_URL).then(r => r.json())` has no response body size limit and can potentially bring down a server due to memory exhaustion if the endpoint at API_URL malfunctions for some reason. Fine in the browser but to me it should be a no-no on the server.

show 2 replies
augusto-mouratoday at 1:42 PM

It doesn't have a need _now_. Axios is more than 10 years old now, and even before axios other libraries did the same utility of making requests easier

MBCooktoday at 3:28 PM

Browsers too.

It’s not needed anymore.