3.0.0 • Published 8 years ago

portable-fetch v3.0.0

Weekly downloads
50,653
License
MIT
Repository
github
Last release
8 years ago

isomorphic-fetch Build Status

Fetch for node and Browserify. Also works in Webpack and React-Native 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 ES6 Promise compatible polyfill, I suggest es6-promise.

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.

Installation

NPM

npm install --save portable-fetch es6-promise

Usage

require('es6-promise').polyfill();
require('portable-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.

elice-api@bayamsell/rest-apicirkleapilibtactful-sdk@purplship/purplship@sudoplatform/sudo-di-cloud-agent@mniranjanmurthy/star-api-client@mniranjanmurthy/msp-api-clientqs-fe1@yotta/alloy-mapengage-call-api-js-sdkspeedcheck-typescript-clientprogram_leader_portal_py@everything-registry/sub-chunk-2458syncdogwire4-api-sdkwschmitt-test2service-api-clientstate_machine_aa_clientv1@cwds/cals-api-client@buyborghi/openapi-js-client@bend-corp/md-editor-new@peregrinadev/bi@peregrinadev/chat@peregrinadev/core@peregrinadev/creditmanager@peregrinadev/notif@peregrinadev/query@peregrinadev/authdiscord-konstantin-api-clientk8s-web-client@meeco/organisation-wallet-api-sdk@meeco/holder-wallet-api-sdkstx_nextworld_api_clientsquare-connect-tssteps-api-clienttimelight-ai-js-api-clienttrident-api-clientusls-ts-fetch@apptec/console-cpp-node-client@ale-de/ov_cirrus_rest_api@akron/scenario-microservice-ts-client@bitblit/saltmine@bitblit/paratrade-common@bjerkio/crayon-api@chirhos/chirhos-api-ts@cfl/autotagging-service@cfl/automatic-taxonomy-generator-service@3wks/sargon-api-node-client@decipherindustries/flazhback-api-lib@decipherindustries/techstack-sso-lib@copromatic/datacopro-clientyalento-fullstackusda-fdc-api-typescript-client@eckdanny-osi/forms-api-client@finbourne/edp_lusid@finbourne/edp_portfolios@iamu/cms-client@iamu/identity-server-client@iamu/user-storage-client@edropin/events-ts-fetch@edropin/store-ts-fetch@edropin/accounts-ts-fetch@edropin/events-react@ema/js-base@ircam/timeside-player@mratsamy/fetch-redux-middleware@meeco/vault-api-sdk@meeco/vc-api-sdk@meeco/keystore-api-sdk@meeco/meeco-passphrasestore-sdk@meeco/svx-api-sdk@meeco/identity-network-api-sdk@jhernandez-movicoders/sga-ia-client@qasymphony/scenario-sdk@sargon/api-client@scillgame/scill-admin-js@scillgame/scill-js@otimogestor/ces_backend_api@otimogestor/hermes@otimogestor/vindi_apioriginstamp-client-fetchopen_api_epsopen_api_ti_inquiryoldp-api-tsongoing_account_information__aispayping-fetch-clientrocksetportlet-builder-uipos-terminal-client-testsl-ts-fetch-sdkidentity-network-api-sdki-magentogti-auth-ts-clienthere-route-matchinghallo-moebeltaxi-fetch-apilibrestapimantle-apimailslurp-swagger-sdk-ts-sravnirukubernetes-javascript-api
3.0.0

8 years ago

2.3.0

8 years ago