Skip to main content

Built and signed on GitHub Actions

# Typescript utils for async, cancellation, etc This is currently a work in progress.

This package works with Bun, Cloudflare Workers, Node.js, Deno, Browsers
JSR Score
70%
Published
3 months ago (0.2.21)

async

This module contains various async coordinated async primitives, some of which use familair semantics found across languages such as Go, Java, and C#.

I
v
AsyncQueue

An async queue that allows for enqueuing and dequeuing items concurrently

f
asyncQueue

asyncQueue creates a new async queue with the given options.

I
ConcurrentExecutor

An executor that executes tasks concurrently.

I
v
Deferred
No documentation available
f
deferred
No documentation available
f
delay
No documentation available
I
v
Executor

An abstraction for executing tasks.

f
fromAsyncIterable
No documentation available
f
fromEvent
No documentation available
f
fromIterableLike
No documentation available
f
fromObservable
No documentation available
T
Job
No documentation available
I
v
JobPool
No documentation available
f
jobPool
No documentation available
I
v
Mutex
No documentation available
f
mutex
No documentation available
c
QueueClosedError

Error thrown when attempting to dequeue an item from close queue.

c
QueueFullError

Error thrown when attempting to enqueue an item into a full queue.

T
QueueOptions

The options to use when creating a new async queue

c
QueueReadOnlyError

Error thrown when attempting to add to a read-only queue.

I
v
Semaphore
No documentation available
f
semaphore
No documentation available
I
v
Signal
No documentation available
f
signal
No documentation available
T
SignalState
No documentation available
I
v
WaitGroup
No documentation available
f
waitGroup

Golang semantic for coordinating the start and end of multiple concurrenct tasks.

I
v
WorkerPool
No documentation available
f
workerPool
No documentation available
T
WorkerPoolOptions
No documentation available

buffer

This module contains buffer for use with push/pull semantics. These buffers are used in async utilities that allow adapting unbounded push to more of an imperative pull async iterators, such as fromEvent, fromObservable, etc. The buffers are used to store events/values until they are consumed. Rules for buffer usage are defined by the BufferStrategy enum and allow for dropping, keeping the latest, throwing an error, keeping all values, or creating a custom buffer strategy.

c
Buffer
No documentation available
I
BufferLike
No documentation available
T
BufferStrategy
No documentation available
T
BufferStrategyOptions
No documentation available
T
BufferStrategySelector
No documentation available
c
RingBuffer
No documentation available

cancellation

This module contains a semantically equivalent cancellation pattern used in C#. This pattern is used to cancel async operations and allow for basic structured concurrent cancellation.

v
Cancellable
No documentation available
I
CancellationController
No documentation available
c
CancellationError
No documentation available
I
CancellationToken
No documentation available
T
Unregister
No documentation available

common

This module contains various utilities for common tasks such as working with objects, strings, encoding, deadlines, and more. These utilities are used across the library and are exported for general use.

v
base64
No documentation available
T
Callable
No documentation available
f
createQueue
No documentation available
I
v
Deadline
No documentation available
f
deadline
No documentation available
c
DeadlineExceededError
No documentation available
T
Defined
No documentation available
f
deriveTimeout
No documentation available
T
ErrorLike
No documentation available
T
EventHandler
No documentation available
T
Func
No documentation available
T
Func0
No documentation available
T
Func1
No documentation available
T
Func2
No documentation available
T
Func3
No documentation available
f
groupBy

Utility function that froups the elements of a provided array based on a specified key selector function.

c
I
List
No documentation available
T
Maybe
No documentation available
T
MaybeResult
No documentation available
c
Md5

Md5 hash

T
Nil
No documentation available
T
NonNil
No documentation available
T
NotNil
No documentation available
T
Nullable
No documentation available
v
objects
No documentation available
v
Once
No documentation available
v
once
No documentation available
I
v
Queue
No documentation available
I
ReadonlyList

A ReadonlyList type that extends ReadonlyArray providing additional functionl methods (e.g., groupBy)

v
strings
No documentation available
T
Supplier
No documentation available
T
TimeoutInput
No documentation available

crypto

This module contains a crypto helper for managing encryption/decryption using a secret/password. The implementation delegates to the standard crypto API's.

c
CryptoError
No documentation available
c
DecryptionError
No documentation available
f
decryptOnce
No documentation available
T
EncryptedData
No documentation available
c
EncryptionError
No documentation available
T
EncryptionSource
No documentation available
f
encryptOnce
No documentation available
f
generateRandomString
No documentation available
c
Secret
No documentation available

errors

This module contains various error utilities for assisting with the detection and handling of transient errors. Much has not been exported as the module is meant to be used as a utility module for limited use.

c
ArgumentNilError
No documentation available
c
DataTooLargeError
No documentation available
v
Errors
No documentation available
f
getErrorForHttpCode
No documentation available
c
HttpNonRetryableError
No documentation available
c
HttpRetryableError
No documentation available
c
InvalidArgumentError
No documentation available
f
isTransientError
No documentation available
c
NonRetryableError
No documentation available
c
RateLimitError
No documentation available
c
RetryableError
No documentation available