@hachibu/reliable-fetch
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

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

📖 Documentation

💻 Examples

📦 NPM Package

Readme

Keywords

Package Sidebar

Install

npm i @hachibu/reliable-fetch

Weekly Downloads

72

Version

1.0.4

License

MIT

Unpacked Size

38.5 kB

Total Files

57

Last publish

Collaborators

  • hachibu