Module

std/node/_stream/duplex.ts>default

Deno standard library
Go to Latest
class default
extends Stream
import { default } from "https://dotland.deno.dev/std@0.110.0/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

optional
_final: (callback: (error?: Error | null | undefined) => void) => void
_read
_readableState: ReadableState
_undestroy
_writableState: WritableState
_write
optional
_writev: writeV | null
allowHalfOpen: boolean
cork
destroyed: boolean
isPaused
off
pause
pipe
readable: boolean
readonly
readableBuffer
readonly
readableEncoding
readonly
readableEnded
readableFlowing: boolean | null
readonly
readableHighWaterMark: number
readonly
readableLength
readonly
readableObjectMode
resume
setEncoding
uncork
unpipe
wrap
writable
readonly
writableBuffer
readonly
writableCorked
readonly
writableEnded
readonly
writableFinished
readonly
writableHighWaterMark
readonly
writableLength
readonly
writableObjectMode
write

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(
chunk: any,
encoding: Encodings,
cb?: () => void,
): void
end(
x?: any | (() => void),
y?: Encodings | (() => void),
z?: () => void,
)
on(event:
| "close"
| "end"
| "pause"
| "readable"
| "resume"
, listener: () => void
): this
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)
)
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:
| "close"
| "end"
| "pause"
| "readable"
| "resume"
, listener: () => void
): this
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:
| (() => void)
| ((chunk: any) => void)
| ((err: Error) => void)
| ((...args: any[]) => void)
)
setDefaultEncoding(encoding: string)
unshift(chunk: any, encoding?: Encodings): boolean