gradle-build-action/node_modules/listenercount
2019-09-21 16:11:55 +02:00
..
test publishing v1 of action 2019-09-21 16:11:55 +02:00
.npmignore publishing v1 of action 2019-09-21 16:11:55 +02:00
circle.yml publishing v1 of action 2019-09-21 16:11:55 +02:00
index.js publishing v1 of action 2019-09-21 16:11:55 +02:00
LICENSE.md publishing v1 of action 2019-09-21 16:11:55 +02:00
package.json publishing v1 of action 2019-09-21 16:11:55 +02:00
README.md publishing v1 of action 2019-09-21 16:11:55 +02:00

listenercount

backwards compatible version of builtin events.listenercount

js standard style

build status

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

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

license

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