https://github.com/blackglory/extra-fetch
🌲 Yet another isomorphism fetch library
https://github.com/blackglory/extra-fetch
browser esm library nodejs npm-package typescript
Last synced: 3 months ago
JSON representation
🌲 Yet another isomorphism fetch library
- Host: GitHub
- URL: https://github.com/blackglory/extra-fetch
- Owner: BlackGlory
- License: mit
- Created: 2021-01-07T13:20:14.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-06-10T18:03:22.000Z (about 3 years ago)
- Last Synced: 2024-04-14T11:39:49.638Z (about 2 years ago)
- Topics: browser, esm, library, nodejs, npm-package, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/extra-fetch
- Size: 1.93 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# extra-fetch
## Install
```sh
npm install --save extra-fetch
# or
yarn add extra-fetch
```
## API
- fetch
- Headers
- Request
- Response
- FormData
- AbortController
- Blob
- EventSource
## Logging
When using `fetch` in Node.js, logging can be enabled by setting the environment variable `EXTRA_FETCH_LOG`.
### Level
- `EXTRA_FETCH_LOG=none`: disable.
- `EXTRA_FETCH_LOG=error`: log ids, timestamps, elapsed time, errors on failure.
- `EXTRA_FETCH_LOG=info`: log all of the above, and the urls, methods, status codes of each request and response.
- `EXTRA_FETCH_LOG=trace`: log all of the above, and the headers of each request and response.
## HTTP/2
When using `fetch` in Node.js, HTTP/2 is enabled by default.
You can disable HTTP/2 by setting the environment variable `EXTRA_FETCH_HTTP2=false`.