deno.com

class WriteStream

extends stream.Writable
  • Extends stream.Writable

Instances of fs.WriteStream are created and returned using the createWriteStream function.

Properties #

#bytesWritten: number

The number of bytes written so far. Does not include data that is still queued for writing.

#path: string | Buffer

The path to the file the stream is writing to as specified in the first argument to createWriteStream. If path is passed as a string, thenwriteStream.path will be a string. If path is passed as a Buffer, thenwriteStream.path will be a Buffer.

#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 WriteStreamEvents>(
event: K,
listener: WriteStreamEvents[K],
): this

events.EventEmitter

  1. open
  2. close
  3. ready
#close(callback?: (err?: ErrnoException | null) => void): void

Closes writeStream. Optionally accepts a callback that will be executed once the writeStreamis closed.

#on<K extends keyof WriteStreamEvents>(
event: K,
listener: WriteStreamEvents[K],
): this
#once<K extends keyof WriteStreamEvents>(
event: K,
listener: WriteStreamEvents[K],
): this
#prependListener<K extends keyof WriteStreamEvents>(
event: K,
listener: WriteStreamEvents[K],
): this
#prependOnceListener<K extends keyof WriteStreamEvents>(
event: K,
listener: WriteStreamEvents[K],
): this