code: function pipeToPromise(pipe) {
    const d = defer();
    let str = '';
  
    pipe.on('data', data => str += data)
      .on('error', d.reject)
      .on('end', () => d.resolve(str));
    return d.promise;
  }
docs: Convert a pipe (stream) to a promise
  
  @param {Stream} pipe
  @returns {Promise}