fetch-everywhere
Version:
Isomorphic WHATWG Fetch API, for ALL node based environments.
8 lines (7 loc) • 304 B
JavaScript
// the whatwg-fetch polyfill installs the fetch() function
// on the global object (window or self)
//
// Return that as the export for use in Webpack, Browserify etc.
require('whatwg-fetch');
var globalObj = typeof self !== 'undefined' && self || this;
module.exports = globalObj.fetch.bind(globalObj);