INNER CODE UNIT · TypeScript

getResultsPath

jeffijoe/awilix · benchmarks/helpers.ts:82

function getResultsPath(): string {
  if (!resultsFilePath) {
    // Allow parent process (run-all.ts) to set a shared filename via env var
    if (process.env.BENCH_RESULTS_FILE) {
      resultsFilePath = process.env.BENCH_RESULTS_FILE
    } else {
      const ts = new Date().toISOString().replace(/[:.]/g, '-')
      resultsFilePath = path.join(__dirname, `RESULTS-${ts}.md`)
    }
  }
  return resultsFilePath
}

/**
 * Appends a section to the results markdown file.
 */
export function appendToResults(title: string, markdown: string): void {
  const section = `\n## ${title}\n\n${markdown}\n`

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…