fetch-with-retries
v2.2.0
Published
Simple and opinionated lib that adds retries out of the box to native Node.js fetch
Downloads
199
Readme
Fetch With Retries
Fetch With Retries is a TypeScript library that provides a robust way to make requests to an API with automatic retry logic. It's designed to handle both network errors and service issues, such as rate limiting.
Features
- Automatic retries for network errors and certain HTTP status codes.
- Exponential backoff for retry delays.
- Support for
Retry-After
andX-RateLimit-Reset
headers. - Customizable retry conditions.
- Timeout option for the fetch request.
- Allow to abort wait between retries with fetch signal and AbortController.
Installation
npm install fetch-with-retries
License
Fetch With Retries is MIT licensed.