index.js
function decodeStream(opts) {
    opts || (opts = {})
    var stream = Transform({ objectMode: true })

    stream._transform = function (data, _, cb) {
      try {
        // decode keys even when keys or values aren't requested specifically
        if ((opts.keys && opts.values) || (!opts.keys && !opts.values)) {
          data.key = ns.decode(data.key, opts)
        }
        else if (opts.keys) {
          data = ns.decode(data, opts)
        }
      }
      catch (err) {
        return cb(err)
      }
      cb(null, data)
    }

    return stream
  }
function decodeStream(opts) {
    opts || (opts = {})
    var stream = Transform({ objectMode: true })

    stream._transform = function (data, _, cb) {
      try {
        // decode keys even when keys or values aren't requested specifically
        if ((opts.keys && opts.values) || (!opts.keys && !opts.values)) {
          data.key = ns.decode(data.key, opts)
        }
        else if (opts.keys) {
          data = ns.decode(data, opts)
        }
      }
      catch (err) {
        return cb(err)
      }
      cb(null, data)
    }

    return stream
  }
function decodeStream ( opts ) { opts || ( opts = { } ) var stream = Transform ( { objectMode : true } ) stream . _transform = function ( data , _ , cb ) { try { // decode keys even when keys or values aren't requested specifically if ( ( opts . keys && opts . values ) || ( ! opts . keys && ! opts . values ) ) { data . key = ns . decode ( data . key , opts ) } else if ( opts . keys ) { data = ns . decode ( data , opts ) } } catch ( err ) { return cb ( err ) } cb ( null , data ) } return stream }
transform stream to decode data keys
transform stream to decode data keys