Package Comparison

@ekaone/retry VS native fetch

Zero-dependency retry primitive · Any async fn · Node 18+ · Browser · Edge · Bun

Supported
Not supported
Partial
N/A
Feature @ekaone/retry fetch
Retry
Automatic retryRetries failed calls without manual loops ✓ built-in ✗ manual
Max attemptsHard cap on total tries including first call ✓ maxAttempts ✗ none
Exponential backoffDelay grows as baseDelay × 2^attempt ✓ built-in ✗ none
Linear backoffDelay grows linearly per attempt ✓ built-in ✗ none
Fixed backoffConstant delay between every attempt ✓ built-in ✗ none
JitterRandomised delay — prevents thundering herd ✓ full jitter ✗ none
Max delay capUpper bound on computed delay (maxDelayMs) ✓ 30s default ✗ none
Control
shouldRetry predicateSelective retry — only on recoverable errors ✓ per-error ✗ none
AbortSignal supportExternal cancellation mid-retry loop ✓ loop-aware ~ per-request only
Total timeoutCap on entire operation including delays ✓ totalTimeoutMs ✗ none
onError hookCallback fired after each failed attempt ✓ per-attempt ✗ none
Error Handling
RetryError with diagnosticsCarries attempts count, lastError, reason ✓ RetryError ✗ raw error
Failure reasonexhausted / aborted / timeout / rejected ✓ reason field ✗ none
Scope
Works with any async fnDB, SDK calls, agent turns, relay dispatch ✓ any Promise ✗ HTTP only
Anthropic / OpenAI / Gemini SDKWorks with all major LLM SDKs ✓ yes ✗ no
Works with native fetchCan wrap any fetch() call too ✓ yes ✓ yes
Runtime & Package
Zero dependencies ✓ zero ✓ native
Node / Browser / Edge / Bun / Deno ✓ universal ✓ universal
ESM + CJS dual output ✓ tsup N/A — native

Retry

Automatic retry

Retries failed calls without manual loops

@ekaone/retry✓ built-in
fetch✗ manual

Max attempts

Hard cap on total tries

@ekaone/retry✓ maxAttempts
fetch✗ none

Exponential backoff

Delay grows as baseDelay × 2^attempt

@ekaone/retry✓ built-in
fetch✗ none

Linear & Fixed backoff

Linear or constant delay strategies

@ekaone/retry✓ built-in
fetch✗ none

Jitter

Randomised delay — prevents thundering herd

@ekaone/retry✓ full jitter
fetch✗ none

Max delay cap

Upper bound on computed delay

@ekaone/retry✓ 30s default
fetch✗ none

Control

shouldRetry predicate

Selective retry on recoverable errors only

@ekaone/retry✓ per-error
fetch✗ none

AbortSignal support

External cancellation mid-retry loop

@ekaone/retry✓ loop-aware
fetch~ per-request

Total timeout

Cap on entire operation including delays

@ekaone/retry✓ totalTimeoutMs
fetch✗ none

onError hook

Callback fired after each failed attempt

@ekaone/retry✓ per-attempt
fetch✗ none

Error Handling

RetryError with diagnostics

Carries attempts, lastError, reason

@ekaone/retry✓ RetryError
fetch✗ raw error

Failure reason

exhausted / aborted / timeout / rejected

@ekaone/retry✓ reason field
fetch✗ none

Scope

Works with any async fn

DB, SDK calls, agent turns, relay dispatch

@ekaone/retry✓ any Promise
fetch✗ HTTP only

Anthropic / OpenAI / Gemini

Works with all major LLM SDKs

@ekaone/retry✓ yes
fetch✗ no

Works with native fetch

Can wrap any fetch() call too

@ekaone/retry✓ yes
fetch✓ yes

Runtime & Package

Zero dependencies

@ekaone/retry✓ zero
fetch✓ native

Node / Browser / Edge / Bun / Deno

@ekaone/retry✓ universal
fetch✓ universal

ESM + CJS dual output

@ekaone/retry✓ tsup
fetchN/A — native