async function write(output, mode, path) {
  const outputPath = checkOutputPath(path);
  return outputPath === 'stdout' ?
    writeToStdout(output) :
    writeFile(outputPath, output, mode);
}
Writes the output.
@param {string} output
@param {LH.OutputMode} mode
@param {string} path
@return {Promise<void>}