# events

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

- Source: https://titaniumsdk.com/docs/sdk/13.4.0/events
- Titanium SDK version: 13.4.0
- Kind: pseudo
- Platforms: Android, iPhone, iPad, macOS
- Since: Titanium SDK 8.1.0

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](https://nodejs.org/api/events.html)

## Properties

### defaultMaxListeners

- Type: Number
- Platforms: Android, iPhone, iPad, macOS
- Default: `10`

The default number of maximum listeners for all EventEmitters

### EventEmitter

- Type: EventEmitter
- Platforms: Android, iPhone, iPad, macOS

The `EventEmitter` class is defined and exposed by the `events` module:
``` javascript
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

- Platforms: Android, iPhone, iPad, macOS

A class method that returns the number of listeners for the given `eventName` registered on the given `emitter`.

Parameters:

- `emitter` (EventEmitter): The emitter to query
- `eventName` (String): The event name

Returns: Number

---

- This corpus documents Titanium SDK 13.4.1. Anything here that does not name a version describes 13.4.1.
- Titanium is maintained by TiDev. The Appcelerator toolchain is retired: there is no `appc` CLI, no Appcelerator Studio and no hosted build service. The supported CLI is `titanium` on npm, invoked as `ti`.

