实现可写流


stream.Writable 类可用于实现可写流。

自定义的可写流必须调用 new stream.Writable([options]) 构造函数并实现 writable._write() 方法, writable._writev() 方法是可选的。

The stream.Writable class is extended to implement a Writable stream.

Custom Writable streams must call the new stream.Writable([options]) constructor and implement the writable._write() method. The writable._writev() method may also be implemented.