docs: function promisfyStream(stream) {
      var ret = new Promise(), called;
  
      function errorHandler() {
          if (!called) {
              called = true;
              spreadArgs(ret.errback, arguments, ret);
              stream.removeListener("error", endHandler);
              stream.removeListener("end", endHandler);
              stream = ret = null;
          }
      }
  
      function endHandler() {
          if (!called) {
              called = true;
              spreadArgs(ret.callback, arguments, ret);
              stream.removeListener("error", endHandler);
              stream.removeListener("end", endHandler);
              stream = ret = null;
          }
      }
  
      stream.on("error", errorHandler).on("end", endHandler);
      return ret.promise();
  }