4.0.2 • Published 1 year ago

isomorphic-unfetch v4.0.2

Weekly downloads
591,627
License
MIT
Repository
github
Last release
1 year ago

Isomorphic Unfetch

Switches between unfetch & node-fetch for client & server.

Install

This project uses node and npm. Go check them out if you don't have them locally installed.

Note: This module uses node-fetch 3.x, which is ES Module and requires Node >= 12.20.0.

$ npm i isomorphic-unfetch

Then with a module bundler like rollup or webpack, use as you would anything else:

// using ES6 modules
import fetch from "isomorphic-unfetch";

// using CommonJS modules
const fetch = require("isomorphic-unfetch");

Usage

As a ponyfill:

import fetch from "isomorphic-unfetch";

fetch("/foo.json")
  .then((r) => r.json())
  .then((data) => {
    console.log(data);
  });

Globally, as a polyfill:

import "isomorphic-unfetch";

// "fetch" is now installed globally if it wasn't already available

fetch("/foo.json")
  .then((r) => r.json())
  .then((data) => {
    console.log(data);
  });

License

MIT License © Jason Miller

@mahmudhamid/norsani-components@zerufin/zeru-sahayakaruamazon-cognito-identity-js@courselit/app@coorpacademy/components@supv/superv-jsdesktop-support-toolsdelchanywebapp-usernextjs-package-rd@travelshift/webmyxd@qlippoth/coregintonicgamestack@polygonplanet-llc/weather@progleasing/micro-frontend-loaderbmoran-react-mui-mapbox-geocoderfigma-plugins-datadealcrane-web-appjsn_web2nextjsexample@mahmudhamid/norsani-forms@tangramhq/tangramauth-ui-tmpfis-reactive-componentsfis-react-core-componentsfis-reactive-corecep-promise-testcirplus-frontend@plusauth/rest-clientplusauth-js-rest@testing4638/json-api-clientml-api-unofficialpacket-processor-api-clientenotarylog-clientnext.webshare.megatsby-source-youtube2@aviosgroup/cbr-clientmirador-biblissimadigitalstage-client-basedigitalstage-mediasoup-web@brudi/brudi-toolbox-nextreact-redirectionmarketing-siteboardgamegeekjsclientxr3-client@dxos/xbox-dashboard@bongusagi/api-core@joseirrazabal/links@joseirrazabal/kit@mikearaya/create-engine@mikearaya/engine-boilerplate@feature-flip/feature-flip-jssonnguyen-refinable-jschangecx-commercetools-connector@busy-bee/ui-wwwupstash-redis@lascelles/monorepo-starter-next-app@duythao_bacoor/sdkbinance-chain-sdk-litecoin-magiccmdb.js@manifoldxyz/manifold-data-client@txdev/element-js-v2chinese-miradortattooswapsdkmdlinx-smartestdocracyshorter-sushi-sdk@amp-nova/dc-demostore-cli@mangolicious/mango-clientgatsby-source-modular-graphqlsdk-tap-and-pay@txdev/nft-walletgrav.clientmoloni-client@aviosgroup/content-client@0x/0x-sdk@kingsene19/crypting-up-sdk@sidharth0911/sdk-demo@infinitebrahmanuniverse/nolb-iso@jfstechapi/sdk@tagong40/demo131@civfund/fund-monitoring@manumonti/staking-rewards-calculation@saaspe/componentshulionjsbloombotmagneumlazychat-sdkhomebridge-mysubaru@everything-registry/sub-chunk-1938@pxwlab/docz-theme-katana@robinblomberg/safe-requestmncorddicomeditdmitry_guzov-sdkdevswap-sdkdossr
4.0.1

1 year ago

4.0.0

1 year ago

4.0.2

1 year ago

3.1.0

4 years ago

3.0.0

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.0

7 years ago

1.0.0

7 years ago

0.1.0

7 years ago