-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsummary.js
More file actions
30 lines (26 loc) · 729 Bytes
/
Copy pathsummary.js
File metadata and controls
30 lines (26 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env node
'use strict';
/**
* Human-readable summary from a results.v1 JSON document.
*
* node tools/benchmarks/summary.js results/latest.json
*/
const path = require('path');
const { readResults, validateResults } = require('./lib/io');
const { renderSummary } = require('./lib/report');
function main() {
const file = process.argv[2];
if (!file) {
console.error('usage: node summary.js <results.json>');
process.exit(2);
}
const doc = readResults(path.resolve(file));
const check = validateResults(doc);
if (!check.ok) {
console.error('invalid results document:');
for (const e of check.errors) console.error(` - ${e}`);
process.exit(1);
}
renderSummary(doc);
}
main();