A stream is an abstract interface for working with streaming data in Node.js. The stream module provides an API for implementing the stream interface.
stream
There are many stream objects provided by Node.js. For instance, a request to an HTTP server and process.stdout are both stream instances.
request to an HTTP server
process.stdout
Streams can be readable, writable, or both. All streams are instances of EventEmitter.
EventEmitter
To access the stream module:
const stream = require('stream');
The stream module is useful for creating new types of stream instances. It is usually not necessary to use the stream module to consume streams.
source
Generated using TypeDoc
A stream is an abstract interface for working with streaming data in Node.js. The
stream
module provides an API for implementing the stream interface.There are many stream objects provided by Node.js. For instance, a
request to an HTTP server
andprocess.stdout
are both stream instances.Streams can be readable, writable, or both. All streams are instances of
EventEmitter
.To access the
stream
module:The
stream
module is useful for creating new types of stream instances. It is usually not necessary to use thestream
module to consume streams.See
source