class default
extends Stream
import { default } from "https://deno.land/std@0.115.1/node/_stream/duplex.ts";
A duplex is an implementation of a stream that has both Readable and Writable attributes and capabilities
Constructors
new
default(options?: DuplexOptions)Properties
Methods
_destroy(error: Error | null, callback: (error?: Error | null) => void): void
_read(size?: number)
_write(): void
chunk: any,
encoding: string,
cb: (error?: Error | null) => void,
cork()
destroy(err?: Error | null, cb?: (error?: Error | null) => void)
end(cb?: () => void): void
end(chunk: any, cb?: () => void): void
isPaused()
on(event: , listener: () => void): this
| "close"
| "end"
| "pause"
| "readable"
| "resume"
on(event: "data", listener: (chunk: any) => void): this
on(event: "error", listener: (err: Error) => void): this
on(event: string | symbol, listener: (...args: any[]) => void): this
on(ev: string | symbol, fn: )
| (() => void)
| ((chunk: any) => void)
| ((err: Error) => void)
| ((...args: any[]) => void)
pause(): this
read(n?: number)
You can override either this method, or the async _read
method
removeAllListeners(ev: )
| "close"
| "data"
| "end"
| "error"
| "pause"
| "readable"
| "resume"
| symbol
| undefined
removeListener(event: , listener: () => void): this
| "close"
| "end"
| "pause"
| "readable"
| "resume"
removeListener(event: "data", listener: (chunk: any) => void): this
removeListener(event: "error", listener: (err: Error) => void): this
removeListener(event: string | symbol, listener: (...args: any[]) => void): this
removeListener(ev: string | symbol, fn: ): this
| (() => void)
| ((chunk: any) => void)
| ((err: Error) => void)
| ((...args: any[]) => void)
resume(): this
setDefaultEncoding(encoding: string)
setEncoding(enc: Encodings): this
uncork()
write()
chunk: any,
x?: WritableEncodings | null | ((error: Error | null | undefined) => void),
y?: ((error: Error | null | undefined) => void),
[captureRejectionSymbol](err?: Error)