async function compileDiagramFromStdin (workflow, file, format) {
  const result = file.replace(/\.(?:mmd|md|markdown)$/, '-stdin.' + format)
  // exec will throw with stderr if there is a non-zero exit code
  return await promisify(exec)(`cat ${workflow}/${file} | \
    node src/cli.js -o ${out}/${result} -c ${workflow}/config.json`
  )
}
Process workflow from stdin into specified format file

@param {string} workflow - Workflow folder.
@param {string} file - Name of mermaid input file relative to workflow folder.
@param {"svg" | "pdf" | "png" | "md"} format - Format of output file.
@throws {Error} if mmdc fails to launch, or if it has exitCode != 0