Package Exports
- @brillout/fetch
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@brillout/fetch) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@brillout/fetch
uses window.fetch if run in the browser and
uses node-fetch if run in Node.js. Works well with Webpack.
This means that no polyfill is used in the browser, saving KBs and delay for your users.
This is also means that IE11 is not supported.
With IE11's decline, not supporting IE11 is more and more an option. According to canisue IE11 is the only browser not implementing fetch: https://caniuse.com/#feat=fetch.
If you want IE11 then use another fetch libraries, see the list of fetch libraries bellow.
Usage
const fetch = require('@brillout/fetch'); // npm install @brillout/fetch
fetch('https://brillout-misc.github.io/game-of-thrones/characters/list.json')
.then(response => response.json())
.then(characters => console.log(characters))List of fetch libraries
- node-fetch - Fetch implementation for Node.js
- whatwg-fetch - Fetch polyfill for the browser
- @brillout-fetch - Universal fetch without IE11 support (Based on native
window.fetchandnode-fetch) - fetch-ponyfill - Universal fetch ponyfill with IE11 support (Based on
whatwg-fetchandnode-fetch) - cross-fetch - Universal fetch ponyfill with IE11 support (Based on
whatwg-fetchandnode-fetch) - isomorphic-fetch - Universal fetch polyfill with IE11 support (based on
node-fetchandwhatwg-fetch)