Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/node/stream.ts>Readable

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
class Readable
extends Stream
Re-export
import { Readable } from "https://deno.land/std@0.82.0/node/stream.ts";

Constructors

new
Readable(options?: ReadableOptions)

Properties

_readableState: ReadableState
destroyed: boolean
off
readable: boolean
readonly
readableBuffer
readonly
readableEncoding
readonly
readableEnded
readableFlowing: boolean | null
readonly
readableHighWaterMark: number
readonly
readableLength
readonly
readableObjectMode

Methods

_destroy(error: Error | null, callback: (error?: Error | null) => void): void
_read(_size?: number)
destroy(err?: Error | null, cb?: () => 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
pipe<T extends Duplex | Writable>(dest: T, pipeOpts?: { end?: boolean; }): T
push(chunk: any, encoding?: Encodings): boolean
read(n?: number)
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
setEncoding(enc: Encodings)
unpipe(dest?: Writable): this
unshift(chunk: any, encoding?: string): boolean
wrap(stream: Stream): this

Wrap an old-style stream as the async data source.

Static Properties

_fromList
ReadableState

Static Methods

from(iterable: Iterable<any> | AsyncIterable<any>, opts?: ReadableOptions): Readable