# super-event-emitter

> 🔨 Lightweight and simple interpretation of popular event management

Latest version **5.0.3** (published 2025-01-20) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 45/100 (D)** — status: stable.

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

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 5.0.3 |
| Published | 2025-01-20 |
| First published | 2016-01-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 0 |
| Unpacked size | 23.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 23 |
| Author | Piotr Kowalski |
| Maintainers | piecioshka, mateuszkocz |
| Keywords | super, event, emitter, observer, events, mixin, on, addEventListener, addListener, bind, off, removeEventListener, removeListener, unbind, emit, dispatchEventListener, dispatchListener, trigger, simple |

## Links

- npm: https://www.npmjs.com/package/super-event-emitter
- Repository: https://github.com/piecioshka/super-event-emitter
- Homepage: https://github.com/piecioshka/super-event-emitter#readme
- Issues: https://github.com/piecioshka/super-event-emitter/issues
- npm.io page: https://npm.io/package/super-event-emitter

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 5.0.3 (latest) — 2025-01-20
- 5.0.2 — 2024-11-24
- 5.0.1 — 2024-11-24
- 5.0.0 — 2024-11-24
- 4.1.18 — 2024-10-28
- 4.1.17 — 2024-10-17
- 4.1.15 — 2024-10-12
- 4.1.14 — 2024-10-09
- 4.1.13 — 2024-10-04
- 4.1.12 — 2019-08-08
- 4.1.11 — 2019-08-07
- 4.1.10 — 2019-08-07
- 4.1.9 — 2019-06-04
- 4.1.8 — 2019-06-01
- 4.1.7 — 2019-06-01
- … 17 more at https://npm.io/package/super-event-emitter/versions

## README

# super-event-emitter

[![node version](https://img.shields.io/node/v/super-event-emitter.svg)](https://www.npmjs.com/package/super-event-emitter)
[![npm version](https://badge.fury.io/js/super-event-emitter.svg)](https://badge.fury.io/js/super-event-emitter)
[![downloads count](https://img.shields.io/npm/dt/super-event-emitter.svg)](https://www.npmjs.com/package/super-event-emitter)
[![size](https://packagephobia.com/badge?p=super-event-emitter)](https://packagephobia.com/result?p=super-event-emitter)
[![license](https://img.shields.io/npm/l/super-event-emitter.svg)](https://piecioshka.mit-license.org)
[![github-ci](https://github.com/piecioshka/super-event-emitter/actions/workflows/testing.yml/badge.svg)](https://github.com/piecioshka/super-event-emitter/actions/workflows/testing.yml)

🔨 Lightweight and simple interpretation of popular event management / aggregation

## Motivation

I was created a blog post (in polish) about motivation why I created this tool:<br/>
<https://piecioshka.pl/blog/2016/01/29/narzedzia-swiata-super-event-emitter.html>

_(I'm sorry, but I don't have time to translate this article into English)_

## Usage — CommonJS

Installation:

```bash
npm install super-event-emitter
```

```javascript
const { SuperEventEmitter } = require('super-event-emitter');

const bar = {};

SuperEventEmitter.mixin(bar);

bar.on('test', function () {
    console.log('triggered!');
});

bar.emit('test');
```

## Usage — ECMAScript Modules `*.mjs` or TypeScript `*.ts`

```ts
import { SuperEventEmitter } from "super-event-emitter";

class Person extends SuperEventEmitter {
    say(message) {
        this.emit('say', message);
    }
}

const p1 = new Person();

p1.on('say', function (message) {
    console.log(message); // 'I love cookie'
});

p1.say('I love cookie');
```

## Documentation

API Documentation is available in separated [document](./docs/api.md).

## License

[The MIT License](https://piecioshka.mit-license.org) @ 2016

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