Skip to content

Latest commit

 

History

History
27 lines (17 loc) · 478 Bytes

readme.md

File metadata and controls

27 lines (17 loc) · 478 Bytes

Node Fetch Universal

Switches between node-fetch on server and built-in fetch in the browser.

Install

Node Fetch >=3.0.0-beta.5 is required.

$ npm install @node-fetch/universal node-fetch

Usage

// CommonJS
const fetch = require('@node-fetch/universal');

// ES Module
import fetch from '@node-fetch/universal';

That's it - now, whenever you make a request, either the built-in fetch or the node-fetch package will be used.

License

MIT