Skip to main content
Module

x/proc/deps.ts

A high-level way to run child processes that is easy, flexible, powerful, and prevents resource leaks.
Very Popular
Go to Latest
import * as proc from "https://deno.land/x/proc@0.19.6/deps.ts";

A collection of APIs to provide help with asynchronous tasks like delays, debouncing, deferreds or pooling.

Classes

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

BufReader implements buffering for a Reader object.

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.

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.

A LimitedReader reads from reader but limits the amount of data returned to just limit bytes. Each call to read updates limit to reflect the new amount remaining. read returns null when limit <= 0 or when the underlying reader returns null.

Reader utility for combining multiple readers

The MuxAsyncIterator class multiplexes multiple async iterators into a single stream. It currently makes an assumption:

  • The final result (the value returned and not yielded from the iterator) does not matter; if there is any, it is discarded.

Reader utility for strings

Writer utility for buffering string chunks

Functions

Make Promise or AsyncIterable abortable with the given signal.

Make AsyncIterable abortable with the given signal.

Make Promise abortable with the given signal.

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.

Creates a Promise with the reject and resolve functions placed as methods on the promise object itself. It allows you to do:

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 delimited bytes from a Reader.

Read big endian 32bit integer from BufReader

Read strings line-by-line from a Reader.

Read big endian 64bit long from BufReader

Read big endian 16bit short from BufReader

Read delimited strings from a Reader.

Slice number into 64bit big endian byte array

Branches the given async iterable into the n branches.

Interfaces

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.

Result type returned by of BufReader.readLine().