🎛️🔁🚀 A tiny, zero‑dependencies retry helper with exponential backoff, jitter, min/max delay, and multiple strategies—usable for KV, HTTP, Durable Objects, or any async function.
Keep your calls resilient with a single import—no more duplicated retry logic across your codebase! ♻️
See docs/README.md for full API, usage, and examples.
See Size Comparison for bundle size and alternatives.
yarn add @variablesoftware/ts-retry-backoff
# or
npm install @variablesoftware/ts-retry-backoffmaxRetries?: numberbaseDelayMs?: numberminDelayMs?: numbermaxDelayMs?: numberstrategy?: (attempt: number, baseMs: number) => numberjitter?: numberretryOn?: (err: unknown) => booleanonRetry?: (err: unknown, attempt: number, delay: number) => voidonSuccess?: (result: unknown, attempt: number) => voidonGiveUp?: (err: unknown, attempt: number) => voidsignal?: AbortSignal
MIT © Rob Friedman / Variable Software
Built with ❤️ by @variablesoftware
Thank you for downloading and using this project. Pull requests are warmly welcomed!
- Naming, logging, error messages, and tests avoid cultural or ableist bias
- Avoids assumptions about input/output formats or encodings
- Faithfully reflects user data — no coercion or silent transformations
- Designed for clarity, predictability, and parity with underlying platforms (e.g., Cloudflare APIs)
- Works well in diverse, multilingual, and inclusive developer environments
Keep your calls resilient with a single import—no more duplicated retry logic across your codebase! ♻️