repl.js
function read (parser, type, key, limit = Infinity) {
  let count = 0

  pipeline(parser, new Writable({
    write (obj, enc, cb) {
      if (typeof type === 'string') key = type

      if (typeof type === 'number') {
        limit = type
        type = undefined
      }

      if (typeof key === 'number') {
        limit = key
        key = undefined
      }

      if (count >= limit) {
        return cb()
      }

      if (type instanceof Object && !(obj instanceof type)) {
        return cb()
      }

      dir(key ? obj[key] : obj, { colors: true })

      count++

      cb()
    },
    objectMode: true
  }), er => {
    log(er || 'ok')
    server.displayPrompt()
  })
}
function read (parser, type, key, limit = Infinity) {
  let count = 0

  pipeline(parser, new Writable({
    write (obj, enc, cb) {
      if (typeof type === 'string') key = type

      if (typeof type === 'number') {
        limit = type
        type = undefined
      }

      if (typeof key === 'number') {
        limit = key
        key = undefined
      }

      if (count >= limit) {
        return cb()
      }

      if (type instanceof Object && !(obj instanceof type)) {
        return cb()
      }

      dir(key ? obj[key] : obj, { colors: true })

      count++

      cb()
    },
    objectMode: true
  }), er => {
    log(er || 'ok')
    server.displayPrompt()
  })
}
function read ( parser , type , key , limit = Infinity ) { let count = 0 pipeline ( parser , new Writable ( { write ( obj , enc , cb ) { if ( typeof type === 'string' ) key = type if ( typeof type === 'number' ) { limit = type type = undefined } if ( typeof key === 'number' ) { limit = key key = undefined } if ( count >= limit ) { return cb ( ) } if ( type instanceof Object && ! ( obj instanceof type ) ) { return cb ( ) } dir ( key ? obj [ key ] : obj , { colors : true } ) count ++ cb ( ) } , objectMode : true } ) , er => { log ( er || 'ok' ) server . displayPrompt ( ) } ) }
Reads all data of type from parser matching key. You can skip type or pass Feed or Entry for only seeing to those. You might also limit messages.
Reads all data of type from parser matching key . You can skip type or pass Feed or Entry for only seeing to those . You might also limit messages .