bin/cli.js
function Parser() {
  var parser = new stream.Transform({ highWaterMark: 100 });
  parser._writableState.objectMode = false;
  parser._readableState.objectMode = true;

  var firstline = true;
  parser._transform = function(record, enc, callback) {
    if (!record || record.length === 0) return;

    if (firstline) {
      firstline = false;

      var parsed = Dyno.deserialize(record);
      if (!Object.keys(parsed).every(function(key) {
        return !!parsed[key];
      })) return this.push(JSON.parse(record.toString()));
    }

    record = Dyno.deserialize(record);

    this.push(record);
    setImmediate(callback);
  };

  return parser;
}
function Parser() {
  var parser = new stream.Transform({ highWaterMark: 100 });
  parser._writableState.objectMode = false;
  parser._readableState.objectMode = true;

  var firstline = true;
  parser._transform = function(record, enc, callback) {
    if (!record || record.length === 0) return;

    if (firstline) {
      firstline = false;

      var parsed = Dyno.deserialize(record);
      if (!Object.keys(parsed).every(function(key) {
        return !!parsed[key];
      })) return this.push(JSON.parse(record.toString()));
    }

    record = Dyno.deserialize(record);

    this.push(record);
    setImmediate(callback);
  };

  return parser;
}
function Parser ( ) { var parser = new stream . Transform ( { highWaterMark : 100 } ) ; parser . _writableState . objectMode = false ; parser . _readableState . objectMode = true ; var firstline = true ; parser . _transform = function ( record , enc , callback ) { if ( ! record || record . length === 0 ) return ; if ( firstline ) { firstline = false ; var parsed = Dyno . deserialize ( record ) ; if ( ! Object . keys ( parsed ) . every ( function ( key ) { return ! ! parsed [ key ] ; } ) ) return this . push ( JSON . parse ( record . toString ( ) ) ) ; } record = Dyno . deserialize ( record ) ; this . push ( record ) ; setImmediate ( callback ) ; } ; return parser ; }
Transform stream parses JSON strings and base64 decodes into buffers
Transform stream parses JSON strings and base64 decodes into buffers