• Stars
    star
    6,957
  • Rank 5,608 (Top 0.2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 10 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Isomorphic WHATWG Fetch API, for Node & Browserify

isomorphic-fetch Build Status

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.

For ease-of-maintenance and backward-compatibility reasons, this library will always be a polyfill. As a "safe" alternative, which does not modify the global, consider fetch-ponyfill.

Why Use Isomorphic Fetch

The Fetch API is currently not implemented consistently across browsers. This module will enable you to use fetch in your Node code in a cross-browser compliant fashion. The Fetch API is part of the Web platform API defined by the standards bodies WHATWG and W3C.

Installation

NPM

npm install --save isomorphic-fetch

Bower

bower install --save isomorphic-fetch

Usage

require('isomorphic-fetch');

fetch('//offline-news-api.herokuapp.com/stories')
	.then(function(response) {
		if (response.status >= 400) {
			throw new Error("Bad response from server");
		}
		return response.json();
	})
	.then(function(stories) {
		console.log(stories);
	});

License

All open source code released by FT Labs is licenced under the MIT licence. Based on the fine work by jxck.

Alternatives

More Repositories

1

denodeify

Standalone denodeify, for all of your callback -> promise needs. Just drop in an ES6 complaint promise library & stir
JavaScript
228
star
2

workshop-making-it-work-offline

Making it work offline, the workshop
JavaScript
217
star
3

ft-style-offline-web-app-part-1

The bare ingredients to create an FT style HTML5 app.
JavaScript
98
star
4

offline-todo

A simple offline todo that works on devices that supports IndexedDB & WebSQL
JavaScript
54
star
5

Promise.prototype.finally

This package has been superseded by https://github.com/es-shims/Promise.prototype.finally as of v2.0.0. Please upgrade!
JavaScript
48
star
6

haikro

A tool to make + deploy node apps as self contained tarballs to Heroku
JavaScript
28
star
7

selective-fastclick

Targeted FastClick
JavaScript
24
star
8

ft-style-offline-web-app-part-2

Going cross platform with IndexedDB, WebSQL and gracefully degrading on IE6.
JavaScript
22
star
9

ft-style-offline-web-app-part-3

Using an iframe to prevent caching multiple masters.
JavaScript
21
star
10

superstore

localStorage, without the bugs, and with an asynchronous api.
JavaScript
13
star
11

offline-news-api

A painfully simple API for getting some news
JavaScript
12
star
12

npm-prepublish

Populates your module's package.json's version property from semvery git tags
JavaScript
12
star
13

s3-static-website-cloudformation

a CloudFormation script that does a static file hosting
8
star
14

offline-todo-dexie

My todo app with Dexie
JavaScript
8
star
15

bumper

Semver bumping git tagging command lining interface
JavaScript
8
star
16

superstore-sync

localStorage, without the bugs
JavaScript
7
star
17

web-app

An offline web app, with all the necessary hacks
JavaScript
6
star
18

ft-style-offline-web-app-part-4

Putting the web back into web app.
JavaScript
6
star
19

s3up

Uploads the contents of a local directory to S3, efficiently
Go
5
star
20

shellpromise

What shelling out from Node should be like
JavaScript
5
star
21

overtime

A wrapper for cross browser WebWorkers so that they can be easily run with inline javascript and may be used in an offline web app
JavaScript
5
star
22

serviceworker-chat

It doesn't really matter if it's useless if it works
JavaScript
5
star
23

sass-example

Sass example project
Ruby
4
star
24

semver-as-a-service

https://api.mattandre.ws/semver/github/matthew-andrews/s3up/~1.0.0
Go
3
star
25

undobrexit.com

HTML
3
star
26

haikro-sass-app

heroku + grunt + sass
JavaScript
3
star
27

offline-todo-with-sync

Syncing promising indexeddbing websqling offlining todo app
JavaScript
3
star
28

auto-deploy

Makefile
2
star
29

fastly-workshop

Perl
2
star
30

serviceworker-simple

A simple Service Worker example
HTML
2
star
31

fetchres

not going to happen
JavaScript
2
star
32

offline-news-server-rendered

Yet another FT style web app, but this time rendered on the server and the client
JavaScript
2
star
33

heroku-deploy-counter

Counts total Heroku deploys
JavaScript
1
star
34

Promise.prototype.end

JavaScript
1
star
35

sw-issues-blank-source-on-start

JavaScript
1
star
36

signed-aws-es-fetch

For signing ElasticSearch fetches to AWS
JavaScript
1
star
37

myrtlejs

JavaScript
1
star
38

messagechannel-demo

A quick test to figure out how SharedWorkers and MessageChannels work
JavaScript
1
star
39

generic-template-vars

Fruit Vars
1
star
40

planning-and-building-a-big-front-end

Workshop – Planning and building a big front-end
CSS
1
star
41

flight-todo

JavaScript
1
star
42

offline-express

JavaScript
1
star
43

offline-todo-promises

Offline todos with Promises
JavaScript
1
star
44

talk-long-life-web-apps

A talk at jQuery UK 2014
JavaScript
1
star
45

localstorage-boot

JavaScript
1
star
46

notify-saucelabs

JavaScript
1
star