# ybm

> Your benchmark.

Latest version **0.0.6** (published 2015-06-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install ybm
pnpm add ybm
yarn add ybm
bun add ybm
```

Provides the command `ybm`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2015-06-24 |
| First published | 2015-06-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Known vulnerabilities | 0 (+7 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Zhonglei Qiu |
| Maintainers | qiu8310 |
| Keywords | ybm, bench, benchmark, watch |

## Links

- npm: https://www.npmjs.com/package/ybm
- Repository: https://github.com/qiu8310/ybm
- Issues: https://github.com/qiu8310/ybm/issues
- npm.io page: https://npm.io/package/ybm

## Dependencies (9)

- [gaze](https://npm.io/package/gaze.md) ^0.5.1
- [ylog](https://npm.io/package/ylog.md) 0.2.2
- [lodash](https://npm.io/package/lodash.md) 3.9.3
- [bluebird](https://npm.io/package/bluebird.md) ^2.9.30
- [fs-extra](https://npm.io/package/fs-extra.md) 0.20.0
- [benchmark](https://npm.io/package/benchmark.md) ^1.0.0
- [commander](https://npm.io/package/commander.md) ^2.8.1
- [human-time](https://npm.io/package/human-time.md) 0.0.1
- [cross-spawn](https://npm.io/package/cross-spawn.md) ^0.4.1

## Recent versions

- 0.0.6 (latest) — 2015-06-24
- 0.0.5 — 2015-06-24
- 0.0.4 — 2015-06-23
- 0.0.3 — 2015-06-23
- 0.0.2 — 2015-06-23
- 0.0.1 — 2015-06-23

## README

# ybm
<!--
[![NPM version](https://badge.fury.io/js/ybm.svg)](https://npmjs.org/package/ybm)
[![GitHub version][git-tag-image]][project-url]
[![Build Status][travis-image]][travis-url]
[![Dependency Status][daviddm-url]][daviddm-image]
[![Code Climate][climate-image]][climate-url]
[![Coverage Status][coveralls-image]][coveralls-url]
-->

Your benchmark.


## CLI

### Install

```bash
npm install --global ybm
```

### Usage


* Watch

  ```bash
  ybm --watch some-benchmark-file
  ```

  When `some-benchmark-file` updated, will trigger re-benchmark this file.


* Cycle

  ```bash
  ybm --cycle 3 some-benchmark-file
  ```

  Run `some-benchmark-file` three times.

* NVM - __switch node version to run your benchmark file__  

  ```bash
  ybm --nvm "iojs-v1.0.4, iojs-v2.0.0" some-benchmark-file
  ```

  Run `some-benchmark-file` on `iojs-v1.0.4` and `iojs-v2.0.0`


__Using `ybm -h` to see more help.__


## NODE


### Install
```bash
npm install --save ybm
```


### Usage

* Single test:

  ```js
  ybm(function() {
    // do task
  });
  ```

* Async test:

  ```js
  ybm(function(done) {
    setTimeout(done, 100);
  });
  ```

* Suite tests:

  ```js
  ybm.suite({
    'test_1': function() { /* do task */ },
    'test_2': function() { /* do task */ },
    'test_3': function() { /* do task */ }
  });  
  ```

* Cycle suite tests:

  ```js
  ybm.cycle(5, {
    'test_1': function() { /* do task */ },
    'test_2': function() { /* do task */ },
    'test_3': function() { /* do task */ }
  });
  ```  

* Matrix suite tests:

  ```js
  var matrix = [
    row1,
    row2,
    //...
  ];
  
  ybm.matrix(matrix, function(row) {
    // create suite according row
    return suite;
  })
  ```
  

* More Examples:

  - [Single benchmark test](./examples/single.js)
  - [Single async benchmark test](./examples/single-async.js)
  - [Array suite benchmark tests](./examples/suite-array.js)
  - [Array suite async benchmark tests](./examples/suite-array-async.js)
  - [Object suite benchmark tests](./examples/suite-object.js)
  - [Cycle suite benchmark tests](./examples/cycle-suite.js)
  - [Matrix suite benchmark tests](./examples/matrix-suite.js)


## TODO

- [x] Add `ybm.cycle` - 2015/06/23
- [x] Support `nvm` to switch node test - 2015/06/24


## Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [gulp](http://gulpjs.com/).


## Thanks

* [benchmark](https://github.com/bestiejs/benchmark.js) - A benchmarking library that works on nearly all JavaScript platforms, supports high-resolution timers, and returns statistically significant results.


## History

[CHANGELOG](CHANGELOG.md)


## License

Copyright (c) 2015 Zhonglei Qiu. Licensed under the MIT license.



[project-url]: https://github.com/qiu8310/ybm
[git-tag-image]: http://img.shields.io/github/tag/qiu8310/ybm.svg
[climate-url]: https://codeclimate.com/github/qiu8310/ybm
[climate-image]: https://codeclimate.com/github/qiu8310/ybm/badges/gpa.svg
[travis-url]: https://travis-ci.org/qiu8310/ybm
[travis-image]: https://travis-ci.org/qiu8310/ybm.svg?branch=master
[daviddm-url]: https://david-dm.org/qiu8310/ybm.svg?theme=shields.io
[daviddm-image]: https://david-dm.org/qiu8310/ybm
[coveralls-url]: https://coveralls.io/r/qiu8310/ybm
[coveralls-image]: https://coveralls.io/repos/qiu8310/ybm/badge.png

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