saveContentToFile = async (renderedContent, outputPath, noOverwriteGlobs = []) => {
  let filePath = outputPath;
  // Might be the same as in the `fs` package, but is an active choice for our default file permission for any rendered files.
  let permissions = 0o666;
  const content = renderedContent.content;

  if (content === undefined || typeof content !== 'string') {
    throw Error(`Template file not rendered correctly, was rendered as ${content}`);
  }
  if (renderedContent.metadata !== undefined) {
    if (renderedContent.metadata.permissions !== undefined) {
      permissions = renderedContent.metadata.permissions;
    }
    if (renderedContent.metadata.fileName !== undefined) {
      const newFileName = renderedContent.metadata.fileName.trim();
      const basepath = path.basename(filePath);
      filePath = filePath.replace(basepath, newFileName);
    }
  }

  // get the final file name of the file
  const finalFileName = path.basename(filePath);
  // check whether the filename should be ignored based on user's inputs
  const shouldOverwrite = !noOverwriteGlobs.some(globExp => minimatch(finalFileName, globExp));

  // Write the file only if it should not be skipped
  if (shouldOverwrite) {
    await writeFile(filePath, content, {
      mode: permissions
    });
  } else {
    await log.debug(logMessage.skipOverwrite(filePath));
  }
}
Save the single rendered react content based on the meta data available.

@private
@param {TemplateRenderResult} renderedContent the react content rendered
@param {String} outputPath Path to the file being rendered.