New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bench-node

Package Overview
Dependencies
Maintainers
0
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bench-node - npm Package Compare versions

Comparing version 0.0.4-beta.2 to 0.0.4-beta.3

15

lib/index.js

@@ -55,5 +55,11 @@ const { reportConsoleBench } = require('./report');

validateObject(options, 'options');
if (options?.reporter) {
validateFunction(options.reporter, 'reporter');
if (options?.reporter !== undefined) {
if (options?.reporter !== false && options?.reporter !== null) {
validateFunction(options.reporter, 'reporter');
}
this.#reporter = options.reporter;
} else {
this.#reporter = reportConsoleBench;
}
if (options?.plugins) {

@@ -64,3 +70,2 @@ validateArray(options.plugins, 'plugin');

this.#plugins = options?.plugins || [new V8NeverOptimizePlugin()];
this.#reporter = options?.reporter || reportConsoleBench;
}

@@ -107,3 +112,5 @@

results[i] = result;
this.#reporter(benchmark, result);
if (this.#reporter) {
this.#reporter(benchmark, result);
}
}

@@ -110,0 +117,0 @@ return results;

{
"name": "bench-node",
"version": "0.0.4-beta.2",
"version": "0.0.4-beta.3",
"description": "",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -82,2 +82,9 @@ # `bench-node`

If you don't want results to be printed to the console, `false` and `null` can be used
```js
const { Suite } = require('bench-node');
const suite = new Suite({ reporter: false });
```
### `suite.add(name[, options], fn)`

@@ -84,0 +91,0 @@

@@ -34,2 +34,9 @@ const { Suite } = require('../lib/index');

it('reporter can be false or null', () => {
[false, null].forEach((r) => {
// doesNotThrow
new Suite({ reporter: r });
});
});
describe('suite.add', () => {

@@ -36,0 +43,0 @@ const bench = new Suite({ reporter: noop });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc