@hachibu/reliable-fetch
v1.0.4
Published
An easy-to-use Node.js library to make the Fetch API more reliable with timeouts, retries, and more.
Downloads
42
Readme
Reliable Fetch
An easy-to-use Node.js library to make the Fetch API more reliable with timeouts, retries, and more.
import reliableFetch from '@hachibu/reliable-fetch'
async function main() {
const timeout = 10 // milliseconds
await reliableFetch('https://google.com')
.on('timeout', () => console.log('timeout triggered'))
.timeout({ timeout })
.catch(console.log)
}
✨ Features
- Timeouts
- Retries with caps, backoff and jitter
- Hedged requests
- Random chaos
- Lifecycle hooks