Home >Web Front-end >JS Tutorial >What are streams in node.js
Official document explanation
1. Stream is an abstract interface implemented by various objects in nodejs.
2. For example, standard input is a stream, and standard output is also a stream.
3. All stream objects are instances of EventEmitter and can emit events.
4. Stream is a data transmission method with a starting point and an end point.
The output of the previous one is the input of the next one
The output of the previous one is the input of the next one
The output of the previous one is the input of the next one
gulp uses the strategy of flow and code over configuration to simplify task writing as much as possible.
Similar to the chain operation in jquery, each method is connected in series to build a complete task.
Writing tasks with gulp can also be regarded as writing tasks with Node.js.
When using streams, gulp does not need to generate a large number of intermediate files and only writes the final output to disk, making the entire process very fast. .
The above is the detailed content of What are streams in node.js. For more information, please follow other related articles on the PHP Chinese website!