# events

A Node.js-compatible implementation of the core events module

Availability
8.1.0
8.1.0
9.2.0
Extends
Object

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

Availability
8.1.0
8.1.0
9.2.0
defaultMaxListeners :Number

The default number of maximum listeners for all EventEmitters

Default: 10


# EventEmitter

Availability
8.1.0
8.1.0
9.2.0
EventEmitter :EventEmitter

The EventEmitter class is defined and exposed by the events module:

const EventEmitter = require('events');

All EventEmitters emit the event 'newListener' when new listeners are added and 'removeListener' when existing listeners are removed.

# Methods

# listenerCount

Availability
8.1.0
8.1.0
9.2.0
listenerCount(emitter, eventName) Number

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