Stream Readable Push Lab

Medium
40.0% Acceptance

In this lab, you will learn how to use stream.Readable.push() to create a readable stream. The push() function is used to push data into the internal buffer of a readable stream.

The stream.Readable API allows for creating custom readable streams in Node.js with control over the flow of the data read. The stream API uses an async iterator, meaning it supports asynchronous iteration over the items pushed through the readable stream.

Concepts

  1. Node.js Streams
  2. Readable Stream
  3. stream.Readable.push()

In this lab, we will create a custom readable stream which reads data (pushed into it) using stream.Readable.push(). We will perform the following tasks:

  1. Create a custom readable stream
  2. Use stream.Readable.push() to push data
  3. Read from the custom readable stream
  4. Observe the data pushed into the readable stream
  5. Work with Async Iterators