lib/encoder.js
function pack(arr, buf) {
  assert(Array.isArray(arr), 'array expected');
  var i;
  buf = buf || new Buffer(0);
  buf = _preamble(buf, arr);
  for(i = 0;i < arr.length;i++) {
    buf = _arr(buf, arr[i]);
  }
  return buf;
}
function pack(arr, buf) {
  assert(Array.isArray(arr), 'array expected');
  var i;
  buf = buf || new Buffer(0);
  buf = _preamble(buf, arr);
  for(i = 0;i < arr.length;i++) {
    buf = _arr(buf, arr[i]);
  }
  return buf;
}
function pack ( arr , buf ) { assert ( Array . isArray ( arr ) , 'array expected' ) ; var i ; buf = buf || new Buffer ( 0 ) ; buf = _preamble ( buf , arr ) ; for ( i = 0 ; i < arr . length ; i ++ ) { buf = _arr ( buf , arr [ i ] ) ; } return buf ; }
Pack an array of arrays.

Typcially used when a caller wishes to pack multiple command arrays.

@param arr An array of arrays.
@param buf A buffer to append the encoded contents to (optional).

@return A buffer with the RESP encoded contents.
Pack an array of arrays .