https://github.com/unstubbable/fetch
Universal fetch for Node.js and the browser without polyfill/ponyfill
https://github.com/unstubbable/fetch
Last synced: 3 months ago
JSON representation
Universal fetch for Node.js and the browser without polyfill/ponyfill
- Host: GitHub
- URL: https://github.com/unstubbable/fetch
- Owner: unstubbable
- License: mit
- Created: 2021-06-02T17:11:36.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-02T17:44:53.000Z (about 4 years ago)
- Last Synced: 2025-03-18T06:29:11.629Z (3 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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`:```js
import fetch from "@strictsoftware/fetch";async function fetchSomething() {
return fetch("http://example.com");
}
```