Category

Async

Promise-based utilities for async operations

9 utilities available

delay

Creates a promise that resolves after the specified number of milliseconds.

sleep

Pauses execution for the specified number of milliseconds. Alias for delay without a return value.

retry

Retries an async function until it succeeds or max attempts are reached. Uses exponential backoff between retries.

timeout

Creates a promise that rejects if not resolved within the specified timeout.

parallel

Runs multiple async functions in parallel with a concurrency limit.

series

Runs async functions in series (one after another), passing results sequentially.

waterfall

Runs async functions in series, passing the result of each function to the next. Similar to Array.reduce but for async operations.

race

Creates a promise that resolves or rejects as soon as one of the promises resolves or rejects. Enhanced version of Promise.race with better error handling.

allSettled

Waits for all promises to settle (either resolve or reject) and returns their results. Enhanced version of Promise.allSettled with better TypeScript support.