# @vanillajs/emitter

> A tiny, vanillajs event emitter

Latest version **1.0.0-alpha.7** (published 2019-05-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @vanillajs/emitter
pnpm add @vanillajs/emitter
yarn add @vanillajs/emitter
bun add @vanillajs/emitter
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0-alpha.7 |
| Published | 2019-05-03 |
| First published | 2019-04-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | osdevisnot |

## Links

- npm: https://www.npmjs.com/package/@vanillajs/emitter
- npm.io page: https://npm.io/package/@vanillajs/emitter

## Recent versions

- 1.0.0-alpha.7 (latest) — 2019-05-03
- 1.0.0-alpha.6 — 2019-04-19
- 1.0.0-alpha.3 — 2019-04-14

## README

# @vanillajs/emitter

A tiny, vanillajs event emitter

## Installation

```bash
npm install @vanillajs/emitter
```

## Usage

```js
import emitter from '@vanillajs/emitter';

const unsub = emitter.on('ev', sub);

emitter.emit('ev', { a: 10 }); // emit an event

emitter.off('ev', sub); // unsubscribe using off

unsub(); // unsubscribe by calling the method returned by `on`
```

## Legacy UMD Usage

```html
<script src="//unpkg.com/@vanillajs/emitter"></script>
```

```js
const { emitter } = window.vanillajs;

const unsub = emitter.on('ev', sub);

...
```

[MIT License](https://oss.ninja/mit/osdevisnot) @ [osdevisnot](https://github.com/osdevisnot)

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