code: async function writeStream (filename, contents) {
    await new Promise((resolve, reject) => {
      contents.pipe(fs.createWriteStream(filename))
        .on('finish', function () {
          resolve(filename)
        })
        .on('error', /* istanbul ignore next */ function (err) {
          reject(err)
        })
    })
    return filename
  }
docs: Write a Readable to a file and
  @param {string} filename
  @param {stream.Readable} contents
  @private
  @returns {Promise<string>} a promise for the filename