@strictsoftware/fetch
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

@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");
}

Package Sidebar

Install

npm i @strictsoftware/fetch

Weekly Downloads

851

Version

0.2.1

License

MIT

Unpacked Size

3.82 kB

Total Files

6

Last publish

Collaborators

  • unstubbable