Skip to content

WriteAsync

WriteAsync = (stream, chunk, encoding?) => Promise<void>

Represents an asynchronous write function for Node.js writable streams.

Writable

The writable stream to which data should be written.

The data to write to the stream. Can be a Buffer or a string.

Buffer | string

BufferEncoding

Optional encoding to use when chunk is a string. Defaults to utf8 if omitted.

Promise<void>

A promise that resolves when the data has been successfully written to the stream (including handling backpressure), or rejects if an error occurs.