(filePath: string, events: TraceEvent[])
| 546 | |
| 547 | /** Writes `events` to `filePath` as a Chrome trace JSON array, overwriting it. */ |
| 548 | export async function writeTraceFile(filePath: string, events: TraceEvent[]): Promise<void> { |
| 549 | await fs.mkdir(path.dirname(filePath), {recursive: true}); |
| 550 | await fs.writeFile(filePath, JSON.stringify(events), 'utf8'); |
| 551 | } |
| 552 | |
| 553 | /** Writes `summary` to `filePath` as JSON, overwriting it. */ |
| 554 | export async function writeSummaryFile(filePath: string, summary: PerfSummary): Promise<void> { |