deno.com

class ReadStream

extends stream.Readable

Instances of fs.ReadStream are created and returned using the createReadStream function.

Properties #

#bytesRead: number

The number of bytes that have been read so far.

#path: string | Buffer

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.

#pending: boolean

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

Methods #

#addListener<K extends keyof ReadStreamEvents>(
event: K,
listener: ReadStreamEvents[K],
): this

events.EventEmitter

  1. open
  2. close
  3. ready
#close(callback?: (err?: ErrnoException | null) => void): void
#on<K extends keyof ReadStreamEvents>(
event: K,
listener: ReadStreamEvents[K],
): this
#once<K extends keyof ReadStreamEvents>(
event: K,
listener: ReadStreamEvents[K],
): this
#prependListener<K extends keyof ReadStreamEvents>(
event: K,
listener: ReadStreamEvents[K],
): this
#prependOnceListener<K extends keyof ReadStreamEvents>(
event: K,
listener: ReadStreamEvents[K],
): this