docs: function LDJSONStream(opts) {
    if (opts == null) { opts = {}; }
    if (typeof opts !== 'object') { throw new TypeError('opts must be an object'); }
  
    if (opts.maxDocLength != null && typeof opts.maxDocLength !== 'number') { throw new TypeError('opts.maxDocLength must be a number'); }
    if (opts.maxDocs != null && typeof opts.maxDocs !== 'number') { throw new TypeError('opts.maxDocs must be a number'); }
    if (opts.maxBytes != null && typeof opts.maxBytes !== 'number') { throw new TypeError('opts.maxBytes must be a number'); }
    if (opts.flush != null && typeof opts.flush !== 'boolean') { throw new TypeError('opts.flush must be a boolean'); }
    if (opts.debug != null && typeof opts.debug !== 'boolean') { throw new TypeError('opts.debug must be a boolean'); }
    if (opts.hide != null && typeof opts.hide !== 'boolean') { throw new TypeError('opts.hide must be a boolean'); }
    if (opts.writableObjectMode) { throw new Error('writableObjectMode is not supported, line delimited JSON is required as input'); }
    if (opts.objectMode != null && typeof opts.objectMode !== 'boolean') { throw new TypeError('opts.objectMode must be a boolean'); }
    if (opts.readableObjectMode != null && typeof opts.readableObjectMode !== 'boolean') {
      throw new TypeError('opts.readableObjectMode must be a boolean');
    }
  
    if (opts.objectMode) {
      opts.readableObjectMode = opts.objectMode;
      delete opts.objectMode;
    }
    Transform.call(this, opts);
  
    this._maxDocLength = opts.maxDocLength || 16777216;
  
    this._maxBytes = opts.maxBytes;
    this._maxDocs = opts.maxDocs;
  
    this._flushOpt = opts.flush != null ? opts.flush : true;
    this._debug = opts.debug || false;
    this._hide = !!opts.hide;
    this._objectMode = opts.readableObjectMode;
  
    this.bytesRead = 0;
    this.docsRead  = 0;
  
    this._docptr = 0;
  
    // initialize internal buffer
    this._reset();
  }