4 ms·
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.
by afavour 7mo ago
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.
- deleted 7mo ago[deleted]
- pier25 7mo agoPeople use axios or ky because with fetch you inevitably end up writing a small wrapper on top of it anyway.
- afavour 7mo agoSome might say the tradeoff of writing a small wrapper is worth it given what’s been demonstrated here.
- pier25 7mo agoYeah but what about other deps like db drivers?
- jmull 7mo agoIn my experience people feel the need to wrap axios too.
- kube-system 7mo agoThese are the kind of people I hope AI replaces
- nathancahill 7mo agoAI was trained on Axios wrappers, so it's just going to be wrappers all the way down. Look inside any company "API Client" and it's just a branded wrapper around Axios.
- kube-system 7mo agoSpeak for yourself, Claude works fine with fetch on my system.
- lukeschlather 7mo agoI have never consciously wrapped Axios or fetch, but a cursory search suggests that there was a time when it was impossible for either to force TLS1.3. It's easy to imagine alternate implementations exist for frivolous reasons, but sometimes there are hard security or performance requirements that force you into them.
- zachrip 7mo agoFetch has also lacked support for features that xhr has had for over a decade now. For example upload progress. It's slowly catching up though, upload progress is the only thing I'd choose xhr for.
- apitman 7mo agoYou can pipe through a TransformStream that counts how many bytes you've uploaded, right?
- afavour 7mo agoThat would show how quickly the data is passing into the native fetch call but doesn’t account for kind of internal buffer it might have, network latency etc
- zachrip 7mo agoThat is a way to approximate it, though I'd be curious to know the semantics compared to xhr - would they both show the same value at the same network lifecycle of a given byte?
- cyco130 7mo agoI'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.
- augusto-moura 7mo agoHm, I don't think axios would do much better here. `fetch` is the official replacement for axios. If both are flawed that's another topic
- nailer 7mo ago> `fetch` is the official replacement for axios. No. Axios is still maintained. They have not deprecated the project in favor of fetch.
- augusto-moura 7mo agoI'm not saying that axios is unmaintained, I'm saying that if you want something like axios from the standard lib, fetch is the closest thing you get to official
- nailer 7mo agoSure but Axios determine what the official replacement for Axios is.
- kube-system 7mo agoIt's not deprecated, it's obsoleted.
- sieabahlpark 7mo ago[dead]
- augusto-moura 7mo agoIt 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
- MBCook 7mo agoBrowsers too. It’s not needed anymore.
- deleted 7mo ago[deleted]
- zadikian 7mo agoNode fetch is relatively new. Wasn't marked stable until 2023, though I've used it since like 2018.
- fishpen0 7mo agoIt 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...
- jamesfinlayson 7mo agoYep, got stung because a bunch of things still pull in axios even though we don't use it.
- CountHackulus 7mo agoEvery time I'm reminded of this article about package managers. https://www.gingerbill.org/article/2025/09/08/package-managers-are-evil/ https://www.gingerbill.org/article/2025/09/08/package-manage...
- tyingq 7mo agoServerless framework up until late yesterday also.
- gbibas 7mo ago[dead]
- gbibas 7mo ago[dead]
- Chyzwar 7mo agoBecause native fetch lack retries, error handling is verbose, search and body serialization create ton of boilerplate. I use KY http client, small lib on top of fetch with great UX and trusted maintainer.