lib/BufferStream.js
function attachStreamToSocket(readStream, socketWriteStream, callback, usePipe = false) {
  if (!usePipe) {
    _attachStreamToSocket(readStream, socketWriteStream, callback);
  } else {
    readStream.pipe(socketWriteStream, { end: false });
    readStream.once('end', () => {
      readStream.unpipe();
      callback();
    });
  }
}
function attachStreamToSocket(readStream, socketWriteStream, callback, usePipe = false) {
  if (!usePipe) {
    _attachStreamToSocket(readStream, socketWriteStream, callback);
  } else {
    readStream.pipe(socketWriteStream, { end: false });
    readStream.once('end', () => {
      readStream.unpipe();
      callback();
    });
  }
}
--------------