O'Reilly logo

Sams Teach Yourself Node.js in 24 Hours by George Ornbo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hour 20. The Stream Module

What You’ll Learn in This Hour:

• What streams are

• Creating a readable stream

• Creating a writable stream

• Piping data between readable and writable streams

A Primer on Streams

In UNIX-type operating systems, streams are a standard concept, and there are three main streams:

• Standard input

• Standard output

• Standard error

Programs can read and write from these streams, and because they are a standard interface, it makes it easy to connect small, discrete programs together. In UNIX-type operating systems, it is possible to redirect these streams, so for example, you can redirect standard input to standard output if you want. It is helpful to understand how data flows between streams, so let’s explore this. Suppose ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required