To wait for a stream to finish piping with Node, we use the
For instance, we write
import * as StreamPromises from "stream/promises"; //... await StreamPromises.pipeline(sourceStream, destinationStream);
StreamPromises.pipeline to pipe
await to wait for the promise returned to finish before proceeding.