"We should have some ways of connecting programs like garden hose--screw in another segment when it becomes when it becomes necessary to massage data in another way. This is the way of IO also."
Streams come to us from the earliest days of unix and have proven themselves
over the decades as a dependable way to compose large systems out of small
do one thing well.
In unix, streams are implemented by the shell with
In node, the built-in
is used by the core libraries and easily be used by user-land code.
Similar to unix, the node stream module's primary composition operator is called
Streams can be useful because they restrict the implementation surface area into a single consistent interface. You can then easily plug the output of one stream to the input of another and use libraries that operate abstractly on streams to institute higher-level flow control.
Streams are an important component of small-program design and unix philosophy but there are many other important abstractions worth considering. Just remember that technical debt is the enemy and seek the best abstractions for the problem at hand.