How does PIPE () work in javascript (node.js)? I see it a lot in the gulp and would like to know how the function works directly in javascript.
How does PIPE () work in javascript (node.js)? I see it a lot in the gulp and would like to know how the function works directly in javascript.
The pipe function you saw in gulp actually comes from node.js.
The pipe function is part of the Stream API of node.js. Many things in Node.js are Streams, like HTTP connection, open files, among others. Stream can be translated as stream, or stream, meaning communication between nodes is gradually like a fine stream. For example YouTube, we see the videos being downloaded gradually. That's called Streaming video, is where the server will send bytes of the file gradually, allowing you to watch the video. The same thing is done with any type of file, it is better to work with the server in streaming because it prevents millions of users from processing the same file, and the server can be smarter by sending the file (in the form of Download files). Node.js does streaming better than many platforms.
In case pipe transforms something readable into writeable , that is, it transforms a readable stream into a write stream when collecting data .