Lightweight Node.js library that extends native fetch with automatic retries, exponential backoff with jitter, and request timeout via AbortController. Version 3.0.0 requires Node.js >=22 and ships TypeScript types, ESM, and CJS. Unlike alternatives like node-fetch-retry or got, it returns a native Response object and does not throw on HTTP error statuses (4xx/5xx). It supports customizable retry strategies, strict validation mode, and detailed logging/warning/decision events. Published under MIT license with automated CI on Node 22, 24, and 26.
npm install http-fetch-retryNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows minimal usage: import HttpClient, call fetchWithRetry with a URL, check response.ok, and parse JSON.
Check response.ok or response.status instead of catching errors for HTTP errors.
Replace `new HttpClient(options).fetchWithRetry(...)` with `HttpClient.fetchWithRetry(..., options)`.
Ensure body is re-useable (string, Buffer, Blob, etc.) or disable retries for that request.
Provide at least one HTTP method in retryMethods when strict is true.
Use a re-useable body (string, Buffer, Blob) or increase maxRetries only when body is re-useable.
Upgrade Node.js to >=22 or use dynamic import().
Use `import { HttpClient } from 'http-fetch-retry'` (named import).No dependency data recorded yet.