4 ms·
> It’s news, but is it big? As someone who has been working almost exclusively on Node.js applications for years now, this is big. Front-end developers have,
by samtho 5y ago
> It’s news, but is it big?
As someone who has been working almost exclusively on Node.js applications for years now, this is big.
Front-end developers have, for years, enjoyed this wrapper around the clunky XHR API. It is simple, intuitive, and it comes _free_ in the browser environment (and was easily shimmable before it was standard). Additionally, the depreciation of the popular request[0] a while ago, there has been a gap in The Right Way to do http requests without going into the low-level API that ‘http(s)’ provides. Fetch is promised-based (enabling seamless async/await) and, most importantly, standardized.
Basically, fetch provides a meaningful abstraction atop each platforms’ implementation of http-request-doing further unifying server-side and client-side patterns and idioms.
[0]: https://www.npmjs.com/package/request https://www.npmjs.com/package/request
- wruza 5y agonpm i request node-fetch make-fetch-happen axios. Just out of top of my head.