# iris-event-emitter

> 简单的发布订阅器

Latest version **0.0.2** (published 2023-05-16) · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2023-05-16 |
| First published | 2023-05-16 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | iris_666 |
| Keywords | event, event emit, pubsub |

## Links

- npm: https://www.npmjs.com/package/iris-event-emitter
- npm.io page: https://npm.io/package/iris-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

- 0.0.2 (latest) — 2023-05-16
- 0.0.0 — 2023-05-16

## README

# iris-event-emitter
简单的发布订阅器

# 食用方法：
```
import Emitter from 'iris-event-emitter';

const emitter = new Emitter();

const eventTag = 'event_1';
// subscribe
const unSubscribe_1 = emitter.subscirbe('event_1', () => {console.log('event 1 callback exec')});
const unSubscribe_2 = emitter.subscirbe('event_1', () => {console.log('event 2 callback exec')});
// publish
emitter.publish('event_1');
// unsubscribe
unSubscribe_1();
unSUbscribe_2();
```

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