JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5978934
  • Score
    100M100P100Q221133F
  • License MIT

Fetch for node

Package Exports

  • isomorphic-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 (isomorphic-fetch) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

isomorphic-fetch

Fetch for node and Browserify. Built on top of GitHub's WHATWG Fetch polyfill.

Warnings

  • This adds fetch as a global so that its API is consistent between client and server.
  • You must bring your own Promise polyfill, I suggest es6-promise.

Installation

npm install --save isomorphic-fetch es6-promise

Usage

require('es6-promise').polyfill();
require('isomorphic-fetch');

fetch('https://offline-news-api.herokuapp.com/stories')
    .then(function(response) {
        return response.json();
    })
    .then(function(stories) {
        console.log(stories);
    });

License

All open source code released by FT Labs is licenced under the MIT licence.