Closed RafaelGSS closed 4 months ago
This commit adds support to console output and JSON output. It checks if the script was run without echoing to a file:
$ node index.js Running Node.js Package Benchmark... ---------------------------------------------------------- babel transform (code=true ast=true): 70.09 (3 samples) transform (code=false): 78.57 (2 samples) dotenv config: 31.09K (5 samples) lodash .chunk: 24.47M (5 samples) .groupBy: 3.343M (7 samples) .includes: 10.35M (6 samples) .orderBy: 921.3K (8 samples) moment format (full): 504.7K (7 samples) format: 441K (4 samples) fromNow (YYYYMMDD): 73K (9 samples) subtract (10): 134K (5 samples) pinojs info (10x): 109.1K (4 samples) prettier format (semi=true): 773.5K (3 samples) format (singleQuote=true semi=true tabs=true): 593.7K (3 samples) format (singleQuote=false semi=false tabs=false): 473.4K (3 samples) underscore .chunk: 3.15M (3 samples) .groupBy: 1.003M (3 samples) .includes: 6.588M (4 samples) .orderBy: 488.7K (5 samples) winston info (10x): 24.48K (4 samples)
Then calling pretty console output, or when pipe is found
$ node index.js > results.json $ cat result.json [ { "name": "babel", "method": "benchmarkjs", "operations": [ { "name": "transform (code=true ast=true)", "opsSec": 67.80076532539411, "samples": 3 }, { ...
Resulting in a JSON output.
Depends on https://github.com/nodesource/nodejs-package-benchmark/pull/3
This commit adds support to console output and JSON output. It checks if the script was run without echoing to a file:
Then calling pretty console output, or when pipe is found
Resulting in a JSON output.
Depends on https://github.com/nodesource/nodejs-package-benchmark/pull/3