# emmi

> > WIP

Latest version **0.9.0** (published 2023-08-17) · 0 weekly downloads

## Install

```sh
npm install emmi
pnpm add emmi
yarn add emmi
bun add emmi
```

## 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.9.0 |
| Published | 2023-08-17 |
| First published | 2023-08-09 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | anderscan |

## Links

- npm: https://www.npmjs.com/package/emmi
- npm.io page: https://npm.io/package/emmi

## Recent versions

- 0.9.0 (latest) — 2023-08-17
- 0.8.0 — 2023-08-14
- 0.7.0 — 2023-08-14
- 0.6.1 — 2023-08-14
- 0.5.1 — 2023-08-14
- 0.5.0 — 2023-08-13
- 0.4.0 — 2023-08-11
- 0.3.0 — 2023-08-11
- 0.2.0 — 2023-08-11
- 0.1.0 — 2023-08-10
- 0.0.1 — 2023-08-09

## README

# emmi

> WIP

Inspired by [mitt](https://github.com/developit/mitt/tree/main), but with a large modification: listeners return a response to the `emit` caller.

When defining an event i `emmi`, you need to type it with an `input` and `output` field. Calling `emit` will return an `Output[]` value. `Output` can be anything you want.

Also added an `onReply` listener that receives the `Input` and `Output[]` result of an `emit`.

This enables some interesting patterns not possible with most event emitters.

## Listeners

Listeners can return the `Output` type, or simply omit returning anything. For convenience, listeners that return `undefined`/`void` will not be added to the `Output[]` result of an `emit`.

Note that async functions that return `undefined` (`Promise<undefined>`) **will** be returned

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