https://github.com/fabiospampinato/fetch-shim
A tiny isomoprhic Fetch function, it just gives you the native one if available, or the one from undici.
https://github.com/fabiospampinato/fetch-shim
fetch isomorphic node shim web
Last synced: 8 months ago
JSON representation
A tiny isomoprhic Fetch function, it just gives you the native one if available, or the one from undici.
- Host: GitHub
- URL: https://github.com/fabiospampinato/fetch-shim
- Owner: fabiospampinato
- License: mit
- Created: 2022-06-01T12:16:18.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-09-24T16:28:49.000Z (over 2 years ago)
- Last Synced: 2025-01-03T02:47:13.076Z (over 1 year ago)
- Topics: fetch, isomorphic, node, shim, web
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# Fetch Shim
An isomoprhic Fetch function, it just gives you the native one if available, or the one from [`undici`](https://github.com/nodejs/undici).
## Install
```sh
npm install --save fetch-shim
```
## Usage
```ts
import fetch from 'fetch-shim';
const response = await fetch ( 'https://jsonplaceholder.typicode.com/todos/1' );
const json = await response.json ();
console.log ( json ); // => { userId: 1, id: 1, title: 'delectus aut autem', completed: false }
```
## License
MIT © Fabio Spampinato