Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/dxx/src/lib/$shared.ts>$logger.TransformWriter

🚀 (Deno) enhanced executor
Latest
class $logger.TransformWriter
implements Writer<I>, Transformer<I, O>
import { $logger } from "https://deno.land/x/dxx@rf/src/lib/$shared.ts";
const { TransformWriter } = $logger;

Constructors

new
TransformWriter(fn?: TransformInContextFn<I, O>, options?: TransformWriterOptions<I, O>)

Type Parameters

optional
I = unknown
optional
O = I

Properties

readonly
_previewers: Writer[]
readonly
_transform: TransformInContextFn<I, O> | null | undefined
readonly
_writeQueue: PQueue
readonly
_writers: WriterDetail[]
readonly
id: string

Optional instance ID; may not be unique

Methods

into(writer: Writer, options?)

Returns a promise which is fulfilled when all pending promised writes have settled. This function can assist in imposing a temporal partial ordering between writes with other code (async or sync).

```ts
// ... async or sync writes ...
x.write(...)
await x.write(...)
// ...
await x.onIdle(); // when settled, all enqueued/pending writes have been completed
// ...
```
transform(i: I, ...inputs: I[])
write(chunk: I)

Static Methods

TransformWriterTransformFn<sI, _sO>(
_context: unknown | null,
_i: sI,
..._inputs: sI[],
)