You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Opening as issue because I am not sure where the code should land.
Shipping a writable wrapper is easy as defining _write and _final methods.
const{Writable}=require('stream');// or "readable-stream" if you preferfunctionWriteTableStream(options){if(!(thisinstanceofWriteTableStream)){returnnewWriteTableStream(options);}options=Object.assign({objectMode: true},options);Writable.call(this,options);this._tableStream=createStream(options);}// or require('util').inherits if you prefer. Honestly, I hate that Object.setPrototypeOf is used thereWriteTableStream.super_=Writable;WriteTableStream.prototype=Object.create(Writable.prototype,{constructor: {configurable: true,enumerable: false,value: WriteTableStream,writable: true}});WriteTableStream.prototype._write=function(chunk,encoding,next){leterr=null;try{this._tableStream.write(chunk);}catch(e){err=e;}next(err);};WriteTableStream.prototype._final=function(done){process.stdout.write('\n',done);};
This allows users to create a pipeline that transforms their data into row arrays. For example maybe read a csv file in a stream.
Opening as issue because I am not sure where the code should land.
Shipping a writable wrapper is easy as defining
_write
and_final
methods.This allows users to create a pipeline that transforms their data into row arrays. For example maybe read a csv file in a stream.
The text was updated successfully, but these errors were encountered: