Node.js · Middle · Question 14 of 75

Why is stream.pipeline() preferred over chaining .pipe()?

Explanation

With .pipe() an error in one stream doesn't close the others. await pipeline(src, transform, dest) from node:stream/promises also works with async/await.

Further reading

Problem with a question

Node.js · Middle · question 14

Test yourself

Take the Node.js · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz