Writable Stream writable
Writable.write (chunk, [encoding], [callback])
Chunk {String | Buffer} The data to write
encoding {string} encoded, if chunk is a string
Callback after callback {Function} data block is written
Returns: {Boolean} True if the data has been processed all.
The return value indicates whether you should continue writing immediately. If the data needs to be stuck internally, it returns false; otherwise, it returns true.
Event Drain If. Write returns false then the drain event indicates that more data can continue to be written
writable.cork () forcibly detain all writes, the data that is stuck is written when the. uncork () or. End () is called
writable.uncork () writes all data that is stuck after the. Cork () call.
writable.end ([chunk],[encoding],[callback])
Chunk the data to write
Encoding encoded, if chunk is a string
The callback after the callback stream is called when no more data is written to the stream, and if given, the call is used as the listener for the finish event
After The event is called, and all data is written to the underlying system, this event is triggered
Event Pipe flow to the source stream of this writable stream occurs when the pipe () method of the readable stream is called and adds this writable stream as its target;
Writer.on (' pipe ',function(src) { console.log (' Something is being channeled to writer ');})
Event Unpipe
Class stream. Duplex
For example, TCP nested word zlib stream Crypto stream
Class stream. Transform is a duplex output computed by the input, with both readable and writable interfaces
such as zlib flow, crypto flow
These two classes also do not introduce, I just look at, it is not used for the time being.
Nodejs some api~ (a) node stream 2