import { Duplex } from "https://deno.land/std@0.92.0/node/stream.ts";
A duplex is an implementation of a stream that has both Readable and Writable attributes and capabilities
Methods
_destroy(error: Error | null, callback: (error?: Error | null) => void): void
destroy(err?: Error | null, cb?: (error?: Error | null) => void)
end(cb?: () => void): void
end(chunk: any, cb?: () => void): void
end(): void
chunk: any,
encoding: Encodings,
cb?: () => void,
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
push(chunk: any, encoding?: Encodings): boolean
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
setDefaultEncoding(encoding: string)
unshift(chunk: any, encoding?: Encodings): boolean
[captureRejectionSymbol](err?: Error)
[Symbol.asyncIterator](): ReadableStreamAsyncIterator