Streams are one of the best features in Node. They have been a big part of the ecosystem since the early days of Node and today thousands of modules exists on npm that help us compose all kinds of great stream-based apps. They allow us to work with large volumes of data in environments with limited resources. In addition to that, they help us decouple our applications by supplying a generic abstraction that most I/O patterns work with.
In this chapter, we're going to explore why streams are such a valuable abstraction, how to safely compose streams together in a production environment, and convenient utilities to stream creation and management.
While this chapter is somewhat theoretical, the recipes contained are foundational to the rest of this book; throughout the following chapters, streams are used regularly in practical examples.