Introduction
Get an overview of what we’ll learn in this chapter. Learn the importance of streams, along with the difference between buffering and streaming.
We'll cover the following...
Streams are one of the most important components and patterns of Node.js. There’s a motto in the community that goes, “Stream all the things!” This alone should be enough to describe the role of streams in Node.js. Dominic Tarr, a top contributor to the Node.js community, defines streams as “Node’s best and most misunderstood idea.” There are different reasons that make Node.js streams so attractive; again, it’s not just related to technical properties, such as performance or efficiency, but it’s more about their elegance and the way they fit perfectly into the Node.js philosophy.
This chapter aims to provide a complete understanding of Node.js streams. The first half of this chapter serves as an introduction to the main ideas, the terminology, and the libraries behind Node.js streams. In the second half, we’ll cover more advanced topics and, most importantly, we’ll explore useful streaming patterns that can make our code more elegant and effective in many circumstances.
In this chapter, we’ll learn about the following topics: ...