iso-whatwg-fetch

1.0.1 • Public • Published

iso-whatwg-fetch

UMD Fetch Module build on top of WHATWG Fetch polyfill & node-fetch

Warnings

  • You must bring your own ES6 Promise compatible polyfill,WHATWG suggest es6-promise.

Installation

npm install --save iso-whatwg-fetch

Usage

commonjs/commonjs2

// you should load you own promise polyfil
var fetch = require('iso-whatwg-fetch');
 
fetch('http://www.google.com').then(function(res) {
    console.log(res);
});

amd

// you should load you own promise polyfil
require('iso-whatwg-fetch', function(fetch){
    fetch('http://www.google.com').then(function(res) {
        console.log(res);
    });
})

browser

<!-- you should load you own promise polyfill -->
<script src="/path/to/iso-whatwg-fetch/lib/index.min.js"></script>
<script type="text/javascript">
    // use fetch here
    fetch('http://www.google.com').then(function(res){
        console.log(res);
    })
</script> 

fetch api doc

Please see WHATWG Fetch repo

License

MIT

Package Sidebar

Install

npm i iso-whatwg-fetch

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • gqk