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.
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
.
Methods #
#addListener(event: "close",listener: () => void,): this
events.EventEmitter
- open
- close
- ready
#addListener(event: "drain",listener: () => void,): this
#addListener(event: "error",listener: (err: Error) => void,): this
#addListener(event: "finish",listener: () => void,): this
#addListener(event: "open",listener: (fd: number) => void,): this
#addListener(event: "pipe",listener: (src: stream.Readable) => void,): this
#addListener(event: "ready",listener: () => void,): this
#addListener(event: "unpipe",listener: (src: stream.Readable) => void,): this
#addListener(event: string | symbol,listener: (...args: any[]) => void,): this
Closes writeStream
. Optionally accepts a
callback that will be executed once the writeStream
is closed.
#prependListener(event: "close",listener: () => void,): this
#prependListener(event: "drain",listener: () => void,): this
#prependListener(event: "error",listener: (err: Error) => void,): this
#prependListener(event: "finish",listener: () => void,): this
#prependListener(event: "open",listener: (fd: number) => void,): this
#prependListener(event: "pipe",listener: (src: stream.Readable) => void,): this
#prependListener(event: "ready",listener: () => void,): this
#prependListener(event: "unpipe",listener: (src: stream.Readable) => void,): this
#prependListener(event: string | symbol,listener: (...args: any[]) => void,): this
#prependOnceListener(event: "close",listener: () => void,): this
#prependOnceListener(event: "drain",listener: () => void,): this
#prependOnceListener(event: "error",listener: (err: Error) => void,): this
#prependOnceListener(event: "finish",listener: () => void,): this
#prependOnceListener(event: "open",listener: (fd: number) => void,): this
#prependOnceListener(event: "pipe",listener: (src: stream.Readable) => void,): this
#prependOnceListener(event: "ready",listener: () => void,): this
#prependOnceListener(event: "unpipe",listener: (src: stream.Readable) => void,): this
#prependOnceListener(event: string | symbol,listener: (...args: any[]) => void,): this