fetch-for-babel-umd

Allows fetch to be used with Babel exporting UMD


Keywords
babel, fetch
License
Unlicense
Install
npm install fetch-for-babel-umd@0.1.0

Documentation

fetch for babel

Purpose

Use this module when creating ES2015 modules that will be exported to UMD via Bower.

Example

import 'fetch-for-babel'
// Adds "fetch" to global scope in Node, does nothing in browser, leaving native fetch alone.
// Browsers without native fetch will require a polyfill.

fetch('https://example.com').then(response => {
  if (response.ok) {
    // do something
  }
}, error => {
  console.error(error)
})