Stream Readable Push Lab
Medium
50.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
- Node.js Streams
- Readable Stream
- 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:
- Create a custom readable stream
- Use stream.Readable.push() to push data
- Read from the custom readable stream
- Observe the data pushed into the readable stream
- Work with Async Iterators