Module

x/proc/legacy/deps.ts

A better way to work with processes in Deno.
Latest
import * as mod from "https://dotland.deno.dev/x/proc@0.21.9/legacy/deps.ts";

Provide help with asynchronous tasks like delays, debouncing, deferring, or pooling.

Classes

c
Buffer
deprecated

A variable-sized buffer of bytes with read() and write() methods.

c
BufferFullError
deprecated
c
BufReader
deprecated
c
BufWriter
deprecated

BufWriter implements buffering for an deno.Writer object. If an error occurs writing to a Writer, no more data will be accepted and all subsequent writes, and flush(), will return the error. After all data has been written, the client should call the flush() method to guarantee all data has been forwarded to the underlying deno.Writer.

c
BufWriterSync
deprecated

BufWriterSync implements buffering for a deno.WriterSync object. If an error occurs writing to a WriterSync, no more data will be accepted and all subsequent writes, and flush(), will return the error. After all data has been written, the client should call the flush() method to guarantee all data has been forwarded to the underlying deno.WriterSync.

Error thrown when {@link Deadline} times out.

c
LimitedReader
deprecated
c
MultiReader
deprecated

Reader utility for combining multiple readers

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.

c
PartialReadError
deprecated

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

c
StringReader
deprecated

Reader utility for strings.

c
StringWriter
deprecated

Writer utility for buffering string chunks.

Variables

Error message emitted from the thrown error while mapping.

Functions

Make {@link Promise} abortable with the given signal.

Make AsyncIterable abortable with the given signal.

Make Promise abortable with the given signal.

Copies from src to dst until either EOF (null) is read from src or an error occurs. It resolves to the number of bytes copied or rejects with the first error encountered while copying.

f
copyN
deprecated

Copy N size at the most. If read size is lesser than N, then returns nread

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

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.

Resolve a {@link Promise} after a given amount of milliseconds.

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

Read Reader r until EOF (null) and resolve to the content as {@link Uint8Array}.

Synchronously reads ReaderSync r until EOF (null) and returns the content as {@link Uint8Array}.

f
readDelim
deprecated

Read delimited bytes from a Reader.

f
readInt
deprecated

Read big endian 32bit integer from BufReader

f
readLines
deprecated

Read strings line-by-line from a Reader.

f
readLong
deprecated

Read big endian 64bit long from BufReader

f
readRange
deprecated

Read a range of bytes from a file or other resource that is readable and seekable. The range start and end are inclusive of the bytes within that range.

f
readRangeSync
deprecated

Read a range of bytes synchronously from a file or other resource that is readable and seekable. The range start and end are inclusive of the bytes within that range.

f
readShort
deprecated

Read big endian 16bit short from BufReader

f
readStringDelim
deprecated

Read Reader chunk by chunk, splitting based on delimiter.

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.

f
sliceLongToBytes
deprecated

Slice number into 64bit big endian byte array

Branches the given async iterable into the n branches.

Create a {@link ReadableStream} of {@link Uint8Array}s from a Reader.

Create a {@link WritableStream} from a Writer.

Write all the content of the array buffer (arr) to the writer (w).

Synchronously write all the content of the array buffer (arr) to the writer (w).

Interfaces

I
ByteRange
deprecated

An abstract interface which when implemented provides an interface to close files/resources that were previously opened.

Options for {@link Deadline}.

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.

Options for delay.

An abstract interface which when implemented provides an interface to read bytes into an array buffer asynchronously.

An abstract interface which when implemented provides an interface to read bytes into an array buffer synchronously.

I
ReadLineResult
deprecated

Result type returned by of BufReader.readLine().

Options for retry.

Options for toReadableStream.

Options for toWritableStream.

An abstract interface which when implemented provides an interface to write bytes from an array buffer to a file/resource asynchronously.

An abstract interface which when implemented provides an interface to write bytes from an array buffer to a file/resource synchronously.

Type Aliases

Utility for representing n-tuple. Used in tee.

Utility for representing n-tuple of. Used in Tuple.