# eruda-benchmark

> Eruda plugin for running JavaScript benchmarks

Latest version **2.0.1** (published 2023-04-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install eruda-benchmark
pnpm add eruda-benchmark
yarn add eruda-benchmark
bun add eruda-benchmark
```

## 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 | 2.0.1 |
| Published | 2023-04-01 |
| First published | 2018-02-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1017.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | redhoodsu |
| Maintainers | surunzi |
| Keywords | eruda, plugin, benchmark |

## Links

- npm: https://www.npmjs.com/package/eruda-benchmark
- Homepage: https://github.com/liriliri/eruda-benchmark#readme
- Issues: https://github.com/liriliri/eruda-benchmark/issues
- npm.io page: https://npm.io/package/eruda-benchmark

## Recent versions

- 2.0.1 (latest) — 2023-04-01
- 2.0.0 — 2020-01-05
- 1.0.0 — 2018-02-06

## README

# eruda-benchmark

[![NPM version][npm-image]][npm-url]
[![License][license-image]][npm-url]

[npm-image]: https://img.shields.io/npm/v/eruda-benchmark.svg
[npm-url]: https://npmjs.org/package/eruda-benchmark
[license-image]: https://img.shields.io/npm/l/eruda-benchmark.svg

Eruda plugin for running JavaScript benchmarks.

## Demo

Browse it on your phone: 
[http://eruda.liriliri.io/?plugin=benchmark](http://eruda.liriliri.io/?plugin=benchmark)

## Install

```bash
npm install eruda-benchmark --save
```

```javascript
eruda.add(erudaBenchmark);
```

Make sure Eruda is loaded before this plugin, otherwise won't work.

## Usage

After initialization:

```javascript
var benchmark = eruda.get('benchmark');

benchmark.add('Test', function () 
{
    var arr = new Array(10000); 
    for (var i = 0; i < 10000; i++) arr[i] = i * 2;
});
benchmark.add('Test Suite', [
    {
        name: 'RegExp#test',
        fn: function () 
        {
            /o/.test('Hello World!');
        }
    },
    {
        name: 'String#indexOf',
        fn: function () 
        {
            'Hello World!'.indexOf('o') > -1;
        }
    },
    {
        name: 'String#match',
        fn: function ()
        {
            !!'Hello World!'.match(/o/);
        }
    }
]);
```

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