lib/encoder.js
function Encoder(options) {
  options = options || {};
  Transform.call(this, {objectMode: true});

  // string length chunk for bulk strings, strings large than this amount
  // are broken over process ticks so as not to block the event loop
  // note this is character length, not byte length
  this.strlen = options.strlen || 4096;

  // maximum array length before iterating using
  // setImmediate
  this.arrlen = 512;

  // allow buffers to be passed through untouched
  this.buffers = options.buffers;

  // treat buffers as bulk strings
  this.return_buffers = options.return_buffers;
}
function Encoder(options) {
  options = options || {};
  Transform.call(this, {objectMode: true});

  // string length chunk for bulk strings, strings large than this amount
  // are broken over process ticks so as not to block the event loop
  // note this is character length, not byte length
  this.strlen = options.strlen || 4096;

  // maximum array length before iterating using
  // setImmediate
  this.arrlen = 512;

  // allow buffers to be passed through untouched
  this.buffers = options.buffers;

  // treat buffers as bulk strings
  this.return_buffers = options.return_buffers;
}
function Encoder ( options ) { options = options || { } ; Transform . call ( this , { objectMode : true } ) ; // string length chunk for bulk strings, strings large than this amount // are broken over process ticks so as not to block the event loop // note this is character length, not byte length this . strlen = options . strlen || 4096 ; // maximum array length before iterating using // setImmediate this . arrlen = 512 ; // allow buffers to be passed through untouched this . buffers = options . buffers ; // treat buffers as bulk strings this . return_buffers = options . return_buffers ; }
Class for encoding javascript types to RESP messages.

Public methods throw an error on an attempt to encode
an invalid type.

Stream methods emit an error event.
Class for encoding javascript types to RESP messages .