
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Bench-CLI is an easy-to-use CLI for running benchmarks.
npm install -g bench-cli
Running benchmarks is designed to be super simple and easy. You simply specify a path
to the directory where your benchmark scenarios are located and then the number of iterations to run for each scenario.
bench <directory> --iterations <number>
If you don't specify a directory
, the command will default to bench
, relative to your current working directory.
Benchmarks are defined by creating a simple object export, known as a Bench
. Each Bench
defines a scenario
function which represents the code to be benchmarked. They can optionally define several hooks which allow for setup and cleanup before and after runs.
module.exports = {
// [Optional] Runs once before all of the scenario iterations
setup() {},
// [Optional] Runs once before each of the scenario iterations
beforeScenario() {},
// The benchmark scenario for which time is recorded
scenario() {},
// [Optional] Runs once after each of the scenario iterations
afterScenario() {},
// [Optional] Runs once after all of the scenario iterations
cleanup() {}
};
Each of the above hooks, including scenario
, is invoked with a context
object that is empty by default. This allows information to be shared between the hooks, without having to rely on module state.
You can only define one scenario
per Bench
and, thus, per file. This limitation is in place to encourage isolation of benchmarking scenarios to help guarantee that you are getting accurate results.
FAQs
An easy-to-use CLI for running benchmarks
We found that bench-cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.