# black-hole

> Measure function performance times on objects

Latest version **0.1.0** (published 2014-06-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install black-hole
pnpm add black-hole
yarn add black-hole
bun add black-hole
```

## 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.1.0 |
| Published | 2014-06-14 |
| First published | 2014-06-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Zolmeister |
| Maintainers | zolmeister |
| Keywords | benchmark, speed, node, proxy, measure, performance |

## Links

- npm: https://www.npmjs.com/package/black-hole
- npm.io page: https://npm.io/package/black-hole

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2014-06-14
- 0.0.1 — 2014-06-14
- 0.0.0 — 2014-06-14

## README

# Black-Hole.js
#### Node.js function performance monitoring

#### Install
`npm install black-hole`

##### Note: requires the `--harmony` flag
`node --harmony app.js`

#### Example
```js
var BlackHole = require('black-hole')

var obj = {
  fn1: function (cb) {
    setTimeout(function () {
      cb(null, 'result')
    }, 100)
  },
  abc: {
    fn2: function () {
      return Promise.resolve(10).delay(100)
    }
  }
}

var quasar = BlackHole(obj)

/*
 * fn1 0.5ms
 * abc.fn2 101.5ms
 */
quasar.fn1(function () {
  quasar.fn2().then(function () {
    console.log(printBlackHole(quasar))
  })
})

function printBlackHole(quasar) {
  return BlackHole.pretty(quasar).map(function (result) {
    return result.name + ' ' + result.ms + 'ms'
  }).join('\n')
}

```

#### Docs
##### BlackHole(Object) -> Watched object
##### BlackHole.pretty(Watched) -> [ {name: 'fn', ms: 10.5 } ]

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