Simple and opinionated library that adds automatic retry logic to native Node.js `fetch` (available since Node 20). Current version 2.3.0. Release cadence is sporadic. Key differentiators: built-in exponential backoff, support for `Retry-After` and `X-RateLimit-Reset` headers, custom retry conditions, timeout option, and ability to abort wait between retries. Unlike more generic retry libraries (e.g., `retry`), this one is tightly focused on fetch and handles rate limiting headers natively.
npm install fetch-with-retriesNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage: fetch with retries, handling TimeoutError, and logging retry attempts.
Either upgrade to Node >= 20 or use a polyfill like 'node-fetch' before calling fetchWithRetries.
Upgrade to 2.1.0+ where timeout correctly uses AbortController to cancel the fetch.
Ensure 'retryIf' also checks for 'error instanceof TypeError' to cover network failures.
Use 'timeout' instead of 'maxRetryTime'.
Use: import { fetchWithRetries } from 'fetch-with-retries';Upgrade Node to >= 20 or use a polyfill like node-fetch.
Add: import { TimeoutError } from 'fetch-with-retries';No dependency data recorded yet.