Skip to content

An easy-to-use Node.js library to make the Fetch API more reliable with timeouts, retries, and more.

License

Notifications You must be signed in to change notification settings

hachibu/reliable-fetch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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