undici-retry
JSON →undici-retry is a JavaScript/TypeScript library designed to integrate robust retry logic with the undici HTTP client. As of version 7.0.0, it provides mechanisms to automatically re-attempt failed HTTP requests based on configurable criteria such as status codes, timeouts, and custom delay resolvers. It is tightly coupled with `undici`, requiring `undici` version 7.0.0 or higher as a peer dependency, and is compatible with Node.js environments version 20 or newer. The library offers two primary functions: `sendWithRetry` for operations where the response body is consumed directly (e.g., JSON parsing), and `sendWithRetryReturnStream` for scenarios requiring stream-based body handling, which is crucial for large responses or custom stream processing. Its release cadence typically aligns with major `undici` releases, adapting to `undici`'s API changes and Node.js version support. Key differentiators include its tight integration with `undici`'s `Dispatcher` and `Client` types, and its `Either` pattern for error handling.
Traffic · last 30 days ↓87% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany · 🇫🇷 France · MA