// A
src.pipe(gzip).pipe(dest);
// B
await pipeline(src, gzip, dest);
.pipe() does not forward errors or destroy the other streams, so failures can leak handles; pipeline() does both and reports one errorpipeline() forwards errors and cleans up every stream in the chain. It resolves or rejects once, with one error.
With .pipe(), an error on one stream does not travel to the others. You need an error listener on every stream. Also, the other streams are not destroyed, which can leave file descriptors (open file handles) open.
".pipe() does not handle backpressure, pipeline() does" is wrong: both handle backpressure.
Read more