# listenercount

> backwards compatible version of builtin events.listenercount

Latest version **1.0.1** (published 2016-02-17) · ISC license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2016-02-17 |
| First published | 2016-02-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | separate (@types/listenercount) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | jden |
| Maintainers | jden |
| Keywords | eventemitter, events, listener, count, listenercount, polyfill, native, builtin |

## Links

- npm: https://www.npmjs.com/package/listenercount
- Repository: https://github.com/jden/node-listenercount
- Homepage: https://github.com/jden/node-listenercount#readme
- Issues: https://github.com/jden/node-listenercount/issues
- npm.io page: https://npm.io/package/listenercount

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2016-02-17
- 1.0.0 — 2016-02-17

## README

# listenercount
backwards compatible version of builtin events.listenercount

[![js standard style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)]()

[![build status](https://circleci.com/gh/jden/node-listenercount.svg?&style=shield)][circleci]

[circleci]: https://circleci.com/gh/jden/node-listenercount
[standard]: http://standardjs.com/

A polyfill of Node.js 0.12+'s events.listenerCount function for Node.js 0.10. Uses the builtin if present, otherwise uses polyfill implementation.

## usage
```js
var listenerCount = require('listenercount')
var EventEmitter = require('events').EventEmitter

var ee = new EventEmitter()
ee.on('event', function () {})
listenerCount(ee, 'event') // => 1
listenerCount(ee, 'foo') // => 0
```


## api
### `listenerCount(ee : EventEmitter, eventName : String) => Number`
Returns the number of listeners for a given `eventName` on an EventEmitter.


## installation

    $ npm install listenercount


## running the tests

From package root:

    $ npm install
    $ npm test


## contributors

- jden <jason@denizac.org>


## license

ISC. (c) MMXVI jden <jason@denizac.org>. See LICENSE.md

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