INNER CODE UNIT · TypeScript
appendToResults
jeffijoe/awilix · benchmarks/helpers.ts:98
export function appendToResults(title: string, markdown: string): void {
const section = `\n## ${title}\n\n${markdown}\n`
fs.appendFileSync(getResultsPath(), section)
}
/**
* Initializes the results file with a header and timestamp.
*/
export function initResultsFile(): void {
const p = getResultsPath()
const header = `# Benchmark Results\n\n**Timestamp:** ${new Date().toISOString()}\n**Node:** ${process.version}\n**Platform:** ${process.platform} ${process.arch}\n`
fs.writeFileSync(p, header)
console.log(`Results file: ${path.basename(p)}`)
}