UNPKG

cross-fetch

Version:

Universal WHATWG Fetch API for Node, Browsers and React Native

12 lines (9 loc) 267 B
const fetchNode = require('./node-ponyfill') const fetch = fetchNode.fetch.bind({}) fetch.polyfill = true if (!global.fetch) { global.fetch = fetch global.Response = fetchNode.Response global.Headers = fetchNode.Headers global.Request = fetchNode.Request }