# crystal-event-emitter

> A small, modern event emitter base class with no dependencies

Latest version **2.1.5** (published 2018-04-23) · GPL-3.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install crystal-event-emitter
pnpm add crystal-event-emitter
yarn add crystal-event-emitter
bun add crystal-event-emitter
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.1.5 |
| Published | 2018-04-23 |
| First published | 2016-01-07 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 46 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | kdex |
| Maintainers | kdex |
| Keywords | event, emitter, crystal, esnext, es2015, es2016, es2017, es6, modern |

## Links

- npm: https://www.npmjs.com/package/crystal-event-emitter
- npm.io page: https://npm.io/package/crystal-event-emitter

## 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

- 2.1.5 (latest) — 2018-04-23
- 2.1.4 — 2018-02-01
- 2.1.3 — 2018-01-26
- 2.1.2 — 2017-07-30
- 2.1.1 — 2017-03-26
- 2.0.2 — 2017-03-26
- 2.0.1 — 2017-03-25
- 2.0.0 — 2017-03-25
- 1.3.1 — 2016-07-01
- 1.3.0 — 2016-07-01
- 1.2.1 — 2016-06-26
- 1.2.0 — 2016-06-26
- 1.1.3 — 2016-04-07
- 1.1.2 — 2016-01-09
- 1.1.1 — 2016-01-09
- … 4 more at https://npm.io/package/crystal-event-emitter/versions

## README

# crystal-event-emitter

[![travis](https://travis-ci.org/kdex/crystal-event-emitter.svg?branch=master)](https://travis-ci.org/kdex/crystal-event-emitter)
[![codecov](https://codecov.io/gh/kdex/crystal-event-emitter/branch/master/graph/badge.svg)](https://codecov.io/gh/kdex/crystal-event-emitter)
[![dependencies](https://david-dm.org/kdex/crystal-event-emitter/status.svg)](https://david-dm.org/kdex/crystal-event-emitter)
[![documentation](https://kdex.github.io/crystal-event-emitter/badge.svg)](https://kdex.github.io/crystal-event-emitter)

A small, modern base class for event emitters — no dependencies.
## Documentation
You can find a documentation [here](https://kdex.github.io/crystal-event-emitter).
## Examples
### Inferred listeners
```js
import EventEmitter from "crystal-event-emitter";
class Cat extends EventEmitter {
	constructor() {
		super({
			inferListeners: true
		});
	}
	onFeed() {
		console.log("More food, please!");
	}
}
const cat = new Cat();
cat.emit("feed"); // "More food, please!"
```
### Manual listeners
```js
import EventEmitter from "crystal-event-emitter";
class Cat extends EventEmitter {
	constructor() {
		super();
	}
	onFeed() {
		console.log("More food, please!");
	}
}
const cat = new Cat();
cat.on("feed", cat.onFeed);
cat.emit("feed"); // "More food, please!"
```

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