# @nodeart/event_emitter

> Simple EventEmitter pattern

Latest version **1.2.3** (published 2018-05-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install @nodeart/event_emitter
pnpm add @nodeart/event_emitter
yarn add @nodeart/event_emitter
bun add @nodeart/event_emitter
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.3 |
| Published | 2018-05-31 |
| First published | 2017-03-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=6.0.0 |
| Dependencies | 0 |
| Unpacked size | 8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Ivan Prodaiko |
| Maintainers | ivan_prodaiko_94, nodeart |
| Keywords | nodeart, emitter, eventemitter, listener |

## Links

- npm: https://www.npmjs.com/package/@nodeart/event_emitter
- Repository: https://github.com/NodeArt/EventEmitter
- Homepage: https://github.com/NodeArt/EventEmitter#readme
- Issues: https://github.com/NodeArt/EventEmitter/issues
- npm.io page: https://npm.io/package/@nodeart/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

- 1.2.3 (latest) — 2018-05-31
- 1.2.2 — 2018-05-15
- 1.2.1 — 2017-06-03
- 1.2.0 — 2017-05-31
- 1.1.0 — 2017-05-26
- 1.0.6 — 2017-04-15
- 1.0.5 — 2017-03-27
- 1.0.4 — 2017-03-23
- 1.0.3 — 2017-03-23
- 1.0.2 — 2017-03-22
- 1.0.1 — 2017-03-22
- 1.0.0 — 2017-03-22

## README

[![bitHound Overall Score](https://www.bithound.io/github/NodeArt/EventEmitter/badges/score.svg)](https://www.bithound.io/github/NodeArt/EventEmitter)
[![bitHound Dependencies](https://www.bithound.io/github/NodeArt/EventEmitter/badges/dependencies.svg)](https://www.bithound.io/github/NodeArt/EventEmitter/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/NodeArt/EventEmitter/badges/code.svg)](https://www.bithound.io/github/NodeArt/EventEmitter)

Methods:
```javascript
const EventEmitter = require('@nodeart/event_emitter');
const events = new EventEmitter();
events.on('eventName', ...fns)
      .once('eventName', ...fns)
      .off('eventName', ...fns)
      .emit('eventName', {
          ctx: true
      }, ...args)
      .times('eventName2', 3, ...fns)
      .offAll();

const inherited = {};

// reset prototype
EventEmitter
    .inherit(inherited)
    .on('smth', ...fns);
    
const extended = {};

// add EventEmitter functionality as mixin
EventEmitter
    .extend(extended)
    .on('smth', ...fns);

// One can remove some functions from listeners array by passing them to .off method,
// but to remove all listeners event use .off with eventName only;
```

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