0
0
Node.jsframework~5 mins

Stream types (Readable, Writable, Transform, Duplex) in Node.js - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a Readable stream in Node.js?
A Readable stream is a source of data you can read from, like a file or network connection. It lets you read data piece by piece instead of all at once.
Click to reveal answer
beginner
What does a Writable stream do?
A Writable stream is a destination where you can send data to be saved or processed, like writing to a file or sending data over the network.
Click to reveal answer
intermediate
Explain a Transform stream in Node.js.
A Transform stream is both readable and writable. It takes input data, changes or processes it, then outputs the transformed data.
Click to reveal answer
intermediate
What is a Duplex stream?
A Duplex stream can read and write data independently. Think of it like a two-way street where data flows in both directions at the same time.
Click to reveal answer
beginner
How do Readable and Writable streams differ in usage?
Readable streams provide data to your program, while Writable streams accept data from your program. They serve opposite roles in data flow.
Click to reveal answer
Which stream type allows you to modify data as it passes through?
AReadable
BWritable
CDuplex
DTransform
What kind of stream can both read and write data independently?
ATransform
BWritable
CDuplex
DReadable
If you want to save data to a file, which stream type do you use?
AWritable
BReadable
CTransform
DDuplex
Which stream type is only a source of data?
AReadable
BWritable
CTransform
DDuplex
Which stream type combines reading and writing but processes data in between?
AReadable
BTransform
CWritable
DDuplex
Describe the four main stream types in Node.js and their roles.
Think about data flow direction and processing.
You got /4 concepts.
    Explain a real-life example where you might use a Transform stream.
    Consider converting file formats or compressing data.
    You got /3 concepts.