Transform and Duplex Stream
have all the methods of readable and writeable, and their events. you put them in between two other streams.
transform
readable + writable stream where:
input -> transform -> output
All the readable AND writable methods are available.
duplex
imagine a separate writable and readable stream but glued together into the same stream instance. Like a telephone. Both sides can talk the same time.
readable + writable stream where input is decoupled from output
like a telephone!
input -> duplex
duplex -> output
All the readable AND writable methods are available.
duplex
If you see:
a.pipe(stream).pipe(a)
then you are dealing with a duplex stream.
Examples
If you create a TCP server in NodeJS with net.server
or net.connect