pipeToAsync

fun pipeToAsync(destination: WritableStream<R>, options: StreamPipeOptions = definedExternally): Promise<Void?>(source)

The pipeTo() method of the ReadableStream interface pipes the current ReadableStream to a given WritableStream and returns a Promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.

MDN Reference