bench-node
Advanced tools
Comparing version 0.2.1 to 0.3.0
@@ -10,2 +10,4 @@ # Plugins | ||
To observe how a plugin is used, see the `plugin-api-doc.js` file in tests and explore its results. | ||
## Structure | ||
@@ -12,0 +14,0 @@ |
@@ -227,3 +227,3 @@ const { debug, types } = require('node:util'); | ||
if (typeof p.onCompleteBenchmark === 'function') { | ||
p.onCompleteBenchmark(result); | ||
p.onCompleteBenchmark(result, bench); | ||
} | ||
@@ -230,0 +230,0 @@ } |
@@ -14,3 +14,3 @@ const { clockBenchmark, debugBench, MIN_RESOLUTION, timer } = require('./clock'); | ||
function parsePluginsResult(plugins) { | ||
function parsePluginsResult(plugins, name) { | ||
const result = [] | ||
@@ -20,4 +20,4 @@ for (const p of plugins) { | ||
name: p.toString(), | ||
result: p.getResult?.() ?? 'enabled', | ||
report: p.getReport?.() ?? '', | ||
result: p.getResult?.(name) ?? 'enabled', | ||
report: p.getReport?.(name) ?? '', | ||
}); | ||
@@ -102,3 +102,3 @@ } | ||
name: bench.name, | ||
plugins: parsePluginsResult(bench.plugins), | ||
plugins: parsePluginsResult(bench.plugins, bench.name), | ||
}; | ||
@@ -105,0 +105,0 @@ } |
{ | ||
"name": "bench-node", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -38,2 +38,9 @@ # `bench-node` | ||
The [`bench-node-cli`](https://github.com/RafaelGSS/bench-node-cli) tool allows you to execute a `bench-node` benchmark | ||
from any location, eliminating the need to install the `bench-node` package locally. | ||
Simply use the following command to run your benchmark: | ||
```bash | ||
npx bench-node-cli my-benchmark.js | ||
``` | ||
See the [examples folder](./examples/) for more common usage examples. | ||
@@ -40,0 +47,0 @@ |
Sorry, the diff of this file is not supported yet
107746
64
1886
359