# events
A Node.js-compatible implementation of the core events
module
NOTE
This is an abstract type. Any object of this structure can be used where this type is used.
# Overview
Titanium provides a number of shims and ports of core Node.js module functionality.
This module is intended to provide a Node-compatible port of the events
.
More details on the Node.js API can be found in their events module documentation (opens new window)
# Properties
# defaultMaxListeners
The default number of maximum listeners for all EventEmitters
Default: 10
# EventEmitter
The EventEmitter
class is defined and exposed by the events
module:
const EventEmitter = require('events');
All EventEmitter
s emit the event 'newListener'
when new listeners are added and 'removeListener'
when existing listeners are removed.
# Methods
# listenerCount
A class method that returns the number of listeners for the given eventName
registered on the given emitter
.
Parameters
Name | Type | Description |
---|---|---|
emitter | EventEmitter | The emitter to query |
eventName | String | The event name |
Returns
- Type
- Number