Skip to main content
Home

@std/async@1.0.16
Built and signed on GitHub Actions

Utilities for asynchronous operations, like delays, debouncing, or pooling

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
6 days ago (1.0.16)

default

Provide helpers with asynchronous tasks like delays, debouncing, retrying, or pooling.

f
abortable

Make a Promise abortable with the given signal.

f
deadline

Create a promise which will be rejected with DOMException when a given delay is exceeded.

I
DeadlineOptions

Options for deadline.

f
debounce

Creates a debounced function that delays the given func by a given wait time in milliseconds. If the method is called again before the timeout expires, the previous call will be aborted.

I
DebouncedFunction

A debounced function that will be delayed by a given wait time in milliseconds. If the method is called again before the timeout expires, the previous call will be aborted.

f
delay

Resolve a Promise after a given amount of milliseconds.

I
DelayOptions

Options for delay.

c
MuxAsyncIterator

Multiplexes multiple async iterators into a single stream. It currently makes an assumption that the final result (the value returned and not yielded from the iterator) does not matter; if there is any result, it is discarded.

f
pooledMap

pooledMap transforms values from an (async) iterable into another async iterable. The transforms are done concurrently, with a max concurrency defined by the poolLimit.

f
retry

Calls the given (possibly asynchronous) function up to maxAttempts times. Retries as long as the given function throws. If the attempts are exhausted, throws a RetryError with cause set to the inner exception.

c
RetryError

Error thrown in retry once the maximum number of failed attempts has been reached.

f
tee

Branches the given async iterable into the n branches.

f
abortable

Make a Promise abortable with the given signal.

f
deadline

Create a promise which will be rejected with DOMException when a given delay is exceeded.

I
DeadlineOptions

Options for deadline.

f
debounce

Creates a debounced function that delays the given func by a given wait time in milliseconds. If the method is called again before the timeout expires, the previous call will be aborted.

I
DebouncedFunction

A debounced function that will be delayed by a given wait time in milliseconds. If the method is called again before the timeout expires, the previous call will be aborted.

f
delay

Resolve a Promise after a given amount of milliseconds.

I
DelayOptions

Options for delay.

c
MuxAsyncIterator

Multiplexes multiple async iterators into a single stream. It currently makes an assumption that the final result (the value returned and not yielded from the iterator) does not matter; if there is any result, it is discarded.

f
pooledMap

pooledMap transforms values from an (async) iterable into another async iterable. The transforms are done concurrently, with a max concurrency defined by the poolLimit.

f
retry

Calls the given (possibly asynchronous) function up to maxAttempts times. Retries as long as the given function throws. If the attempts are exhausted, throws a RetryError with cause set to the inner exception.

c
RetryError

Error thrown in retry once the maximum number of failed attempts has been reached.

f
tee

Branches the given async iterable into the n branches.

c
MuxAsyncIterator

Multiplexes multiple async iterators into a single stream. It currently makes an assumption that the final result (the value returned and not yielded from the iterator) does not matter; if there is any result, it is discarded.

f
retry

Calls the given (possibly asynchronous) function up to maxAttempts times. Retries as long as the given function throws. If the attempts are exhausted, throws a RetryError with cause set to the inner exception.

c
Semaphore

A counting semaphore for limiting concurrent access to a resource.

f
throttle

Creates a throttled function that prevents the given func from being called more than once within a given timeframe in milliseconds.

I
ThrottledFunction

A throttled function that will be executed at most once during the specified timeframe in milliseconds.

T
ThrottleOptions

Options for throttle

f
waitFor

Resolve a Promise after a given predicate becomes true or the timeout amount of milliseconds has been reached.

I
WaitForOptions

Options for waitFor.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.