Node.js Stream Pipeline Lab

Medium
0.0% Acceptance

In this lab, you will work with Node.js streams and the stream.pipeline() function. You will create a readable stream, a writable stream, and use the stream.pipeline() function to transfer data from the readable stream to the writable stream. This lab will help you get hands-on experience with the stream module and understand the importance of stream pipelines in error handling and resource management.

You will be required to build three functions and export them:

  1. createReadStream() - This function should create a readable stream from a given input string.
  2. createWriteStream() - This function should create a writable stream that collects written data.
  3. pipeStreams() - This function should use stream.pipeline() and Promises to transfer data from the readable stream to the writable stream.

Good luck!