4 ms·
Where can I find an explanation about what is Fetch and why it should be in Node.js?
by neves 5y ago
Where can I find an explanation about what is Fetch and why it should be in Node.js?
- neves 5y agoIt looks like it is a new standard: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API I thought it was a Node popular library.
- fiddlerwoaroof 5y agoIt’s “new” as of 6 years ago or so.
- inglor 5y agoThis is fetch: https://github.com/whatwg/fetch https://github.com/whatwg/fetch https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API Here is discussion about it in Node with some (pretty old) discussion https://docs.google.com/document/d/1tn_-0S_FG_sla81wFohi8Sc8YI5PJiTopEzSA7UaLKM/edit?usp=sharing https://docs.google.com/document/d/1tn_-0S_FG_sla81wFohi8Sc8...
- golergka 5y agoFetch is a popular browser api to download and request stuff from the internet. Having the same api both in browser and in node allows easier re-use of the same application code or libraries on frontend and backend.
- tehbeard 5y agofetch is a "modern" (ES6 era, so not brand new) API for making HTTP requests, to replace XMLHttpRequest (the older method that IE pioneered). It's promise based (thus easier to integrate into code than older callback styles), and designed to give some better options around CORS and handling responses. > Why it should be in node? There is a push to adopt some certain "web apis" (APIs that emerged in web browsers) to increase compatibility, reusability and reduce cognitive load when working with both backend and frontend javascript. Having a common low level call like fetch() means that libraries that are built atop it (SDKs to talk to services, or apply common middleware like JSON:API, oAuth etc) can be shared between node/deno and browsers.