Thanks for your reply Lizy. Why do you think fetch can’t be compared to Axios? From my view they are extremely comparable with the major difference being Axios is a standalone 3rd party package, and fetch is a built in standard for modern browsers. They do the same thing (generally) with Axios providing some extra bits (as pointed out by Malcolm Laing) and it is a genuine choice people make and question. So I’m curious what your reasoning is here?
Secondly, I hear you about just use the package if it saves even one line of code; I used to think like that. My opinion now (and I think a lot of developers feel the same) is that NPM can get overused and bloat your app with unnecessary code. Even if size isn’t a concern (for web apps it really should be), there are other things to consider such as maintenance and potentially introduced security flaws.
Don’t get me wrong, I love NPM (and use it A LOT); I just think it has costs that can be forgotten (because it’s so good at managing packages behind the scenes). There are a few medium articles on the topic, but this one’s relatively short and amusing 😁