# @lokua/bench

> Tiny test function using Benchmark.js for quick perf insights

Latest version **1.0.0** (published 2022-03-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @lokua/bench
pnpm add @lokua/bench
yarn add @lokua/bench
bun add @lokua/bench
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-03-14 |
| First published | 2022-03-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 1.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Joshua Kleckner |
| Maintainers | lokua |
| Keywords | benchmark, test |

## Links

- npm: https://www.npmjs.com/package/@lokua/bench
- Repository: https://github.com/Lokua/bench
- Homepage: https://github.com/Lokua/bench#readme
- Issues: https://github.com/Lokua/bench/issues
- npm.io page: https://npm.io/package/@lokua/bench

## Dependencies (1)

- [benchmark](https://npm.io/package/benchmark.md) 2.1.4

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2022-03-14

## README

# bench

> A quick and simple wrapper around [Benchmark.js Suite](https://benchmarkjs.com/docs#Suite)

## Install

```
npm i @lokua/bench
```

## Usage

Create your test file:

```js
// test.js
const bench = require('@lokua/bench')

bench({
  'Test 1': () => {
    // whatever
  },

  'Test 2': () => {
    // whatever
  }
})
```

Then run your file with node from the command line:

```sh
node ./test.js

# ... benchmark logs, something like:

#   Test 1 x 20,762,510 ops/sec ±1.05% (91 runs sampled)
#   Test 2 x 23,006,483 ops/sec ±0.94% (91 runs sampled)
#   Fastest is Test 2
```

---
_Source: https://npm.io/package/@lokua/bench · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
