function streamToPromise (stream) {
  return new Promise(function (resolve, reject) {
    sts(stream, function (err, resStr) {
      if (err) {
        reject(err)
      } else {
        try {
          resolve(JSON.parse(resStr))
        } catch (e) {
          reject(e)
        }
      }
    })
  })
}
Convert a readStream from xray.stream() into
a Promise resolved with written string

@param {Stream} strem
@return {Promise}