JSPM

@strictsoftware/fetch

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

Universal fetch for Node.js and the browser without polyfill/ponyfill

Package Exports

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

Readme

@strictsoftware/fetch

Universal fetch for Node.js and the browser without polyfill/ponyfill.

If you don't need to support a legacy browser that does not provide a native fetch implementation, you can use @strictsoftware/fetch instead of cross-fetch or isomorphic-fetch to avoid unnecessarily bundling a ponyfill/polyfill for fetch in your client bundle.

Install

Install with npm:

npm install --save @strictsoftware/fetch

or yarn:

yarn add @strictsoftware/fetch

Note: The installed node module also includes a d.ts file, and thus works out of the box with TypeScript.

Usage

Import fetch and use it just as you would use the browser's fetch function or node-fetch:

import fetch from "@strictsoftware/fetch";

async function fetchSomething() {
  return fetch("http://example.com");
}