Class ReadStream

Hierarchy

  • Readable
    • ReadStream

Implements

  • ReadStream

Constructors

  • Parameters

    • Optionaloptions: ReadableOptions

    Returns ReadStream

Properties

_readableState: ReadableState
"[asyncDispose]": never
bytesRead: number

The number of bytes that have been read so far.

v6.4.0

closed: boolean
destroyed: boolean
errored: null | Error
path: string | Buffer<ArrayBufferLike>

The path to the file the stream is reading from as specified in the first argument to fs.createReadStream(). If path is passed as a string, thenreadStream.path will be a string. If path is passed as a Buffer, thenreadStream.path will be a Buffer. If fd is specified, thenreadStream.path will be undefined.

v0.1.93

pending: boolean

This property is true if the underlying file has not been opened yet, i.e. before the 'ready' event is emitted.

v11.2.0, v10.16.0

readable: boolean
readableAborted: never
readableDidRead: never
readableEncoding: never
readableEnded: never
readableFlowing: null | boolean
readableHighWaterMark: number
readableLength: number
readableObjectMode: never

Methods

  • Parameters

    • error: null | Error
    • callback: (error?: null | Error) => void

    Returns void

  • Parameters

    • size: number

    Returns void

  • Returns void

  • Returns AsyncIterableIterator<any, any, any>

  • Event emitter The defined events on documents including:

    1. close
    2. data
    3. end
    4. readable
    5. error

    Parameters

    • event: "close"
    • listener: () => void

    Returns this

  • Event emitter The defined events on documents including:

    1. close
    2. data
    3. end
    4. readable
    5. error

    Parameters

    • event: "data"
    • listener: (chunk: any) => void

    Returns this

  • Event emitter The defined events on documents including:

    1. close
    2. data
    3. end
    4. readable
    5. error

    Parameters

    • event: "end"
    • listener: () => void

    Returns this

  • Event emitter The defined events on documents including:

    1. close
    2. data
    3. end
    4. readable
    5. error

    Parameters

    • event: "readable"
    • listener: () => void

    Returns this

  • Event emitter The defined events on documents including:

    1. close
    2. data
    3. end
    4. readable
    5. error

    Parameters

    • event: "error"
    • listener: (err: Error) => void

    Returns this

  • Event emitter The defined events on documents including:

    1. close
    2. data
    3. end
    4. readable
    5. error

    Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void

    Returns this

  • Parameters

    • Optionaloptions: SignalOption

    Returns Readable

  • Type Parameters

    • T extends ReadableStream

    Parameters

    • stream: T | ComposeFnParam | Iterable<T, any, any> | AsyncIterable<T, any, any>
    • Optionaloptions: { signal: AbortSignal }

    Returns T

  • Parameters

    • Optionalerror: Error

    Returns this

  • Parameters

    • limit: number
    • Optionaloptions: SignalOption

    Returns Readable

  • Parameters

    • event: "close"

    Returns boolean

  • Parameters

    • event: "data"
    • chunk: any

    Returns boolean

  • Parameters

    • event: "end"

    Returns boolean

  • Parameters

    • event: "readable"

    Returns boolean

  • Parameters

    • event: "error"
    • err: Error

    Returns boolean

  • Parameters

    • event: string | symbol
    • ...args: any[]

    Returns boolean

  • Returns (string | symbol)[]

  • Parameters

    • fn: (data: any, options?: SignalOption) => boolean | Promise<boolean>
    • Optionaloptions: ArrayOptions

    Returns Promise<boolean>

  • Parameters

    • fn: (data: any, options?: SignalOption) => boolean | Promise<boolean>
    • Optionaloptions: ArrayOptions

    Returns Readable

  • Type Parameters

    • T

    Parameters

    • fn: (data: any, options?: SignalOption) => data is T
    • Optionaloptions: ArrayOptions

    Returns Promise<undefined | T>

  • Parameters

    • fn: (data: any, options?: SignalOption) => boolean | Promise<boolean>
    • Optionaloptions: ArrayOptions

    Returns Promise<any>

  • Parameters

    • fn: (data: any, options?: SignalOption) => any
    • Optionaloptions: ArrayOptions

    Returns Readable

  • Parameters

    • fn: (data: any, options?: SignalOption) => void | Promise<void>
    • Optionaloptions: ArrayOptions

    Returns Promise<void>

  • Returns number

  • Returns boolean

  • Parameters

    • Optionaloptions: { destroyOnReturn?: boolean }

    Returns AsyncIterableIterator<any, any, any>

  • Parameters

    • eventName: string | symbol

    Returns number

  • Parameters

    • eventName: string | symbol

    Returns Function[]

  • Parameters

    • fn: (data: any, options?: SignalOption) => any
    • Optionaloptions: ArrayOptions

    Returns Readable

  • Parameters

    • eventName: string | symbol
    • listener: (...args: any[]) => void

    Returns this

  • Parameters

    • event: "close"
    • listener: () => void

    Returns this

  • Parameters

    • event: "data"
    • listener: (chunk: any) => void

    Returns this

  • Parameters

    • event: "end"
    • listener: () => void

    Returns this

  • Parameters

    • event: "readable"
    • listener: () => void

    Returns this

  • Parameters

    • event: "error"
    • listener: (err: Error) => void

    Returns this

  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void

    Returns this

  • Parameters

    • event: "close"
    • listener: () => void

    Returns this

  • Parameters

    • event: "data"
    • listener: (chunk: any) => void

    Returns this

  • Parameters

    • event: "end"
    • listener: () => void

    Returns this

  • Parameters

    • event: "readable"
    • listener: () => void

    Returns this

  • Parameters

    • event: "error"
    • listener: (err: Error) => void

    Returns this

  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void

    Returns this

  • Returns this

  • Type Parameters

    • T extends _IWritable

    Parameters

    • destination: T
    • Optionaloptions: { end?: boolean }

    Returns T

  • Parameters

    • event: "close"
    • listener: () => void

    Returns this

  • Parameters

    • event: "data"
    • listener: (chunk: any) => void

    Returns this

  • Parameters

    • event: "end"
    • listener: () => void

    Returns this

  • Parameters

    • event: "readable"
    • listener: () => void

    Returns this

  • Parameters

    • event: "error"
    • listener: (err: Error) => void

    Returns this

  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void

    Returns this

  • Parameters

    • event: "close"
    • listener: () => void

    Returns this

  • Parameters

    • event: "data"
    • listener: (chunk: any) => void

    Returns this

  • Parameters

    • event: "end"
    • listener: () => void

    Returns this

  • Parameters

    • event: "readable"
    • listener: () => void

    Returns this

  • Parameters

    • event: "error"
    • listener: (err: Error) => void

    Returns this

  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void

    Returns this

  • Parameters

    • chunk: any
    • Optionalencoding: string

    Returns boolean

  • Parameters

    • eventName: string | symbol

    Returns Function[]

  • Parameters

    • Optionalsize: number

    Returns any

  • Type Parameters

    • T = any

    Parameters

    • fn: (previous: any, data: any, options?: Pick<ArrayOptions, "signal">) => T
    • Optionalinitial: undefined
    • Optionaloptions: Pick<ArrayOptions, "signal">

    Returns Promise<T>

  • Type Parameters

    • T = any

    Parameters

    • fn: (previous: T, data: any, options?: Pick<ArrayOptions, "signal">) => T
    • initial: T
    • Optionaloptions: Pick<ArrayOptions, "signal">

    Returns Promise<T>

  • Parameters

    • Optionalevent: string | symbol

    Returns this

  • Parameters

    • event: "close"
    • listener: () => void

    Returns this

  • Parameters

    • event: "data"
    • listener: (chunk: any) => void

    Returns this

  • Parameters

    • event: "end"
    • listener: () => void

    Returns this

  • Parameters

    • event: "readable"
    • listener: () => void

    Returns this

  • Parameters

    • event: "error"
    • listener: (err: Error) => void

    Returns this

  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void

    Returns this

  • Returns this

  • Parameters

    • encoding: string

    Returns this

  • Parameters

    • n: number

    Returns this

  • Parameters

    • fn: (data: any, options?: SignalOption) => boolean | Promise<boolean>
    • Optionaloptions: ArrayOptions

    Returns Promise<boolean>

  • Parameters

    • limit: number
    • Optionaloptions: SignalOption

    Returns Readable

  • Parameters

    • Optionaloptions: SignalOption

    Returns Promise<any[]>

  • Parameters

    • Optionaldestination: Writable

    Returns this

  • Parameters

    • chunk: any

    Returns void

  • Parameters

    • oldStream: ReadableStream

    Returns this