# @stacksjs/events

> Functional event emitting.

Latest version **0.74.45** (published 2026-09-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @stacksjs/events
pnpm add @stacksjs/events
yarn add @stacksjs/events
bun add @stacksjs/events
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.74.45 |
| Published | 2026-09-11 |
| First published | 2022-12-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 620 |
| Author | Chris Breuer |
| Maintainers | chrisbreuer, glenn123 |
| Keywords | events, functional, functions, mitt, stacks |

## Links

- npm: https://www.npmjs.com/package/@stacksjs/events
- Repository: https://github.com/stacksjs/stacks
- Homepage: https://github.com/stacksjs/stacks/tree/main/storage/framework/core/events#readme
- Issues: https://github.com/stacksjs/stacks/issues
- Funding: https://github.com/sponsors/chrisbbreuer
- npm.io page: https://npm.io/package/@stacksjs/events

## 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.74.45 (latest) — 2026-09-11
- 0.74.43 — 2026-09-11
- 0.74.42 — 2026-09-10
- 0.74.41 — 2026-09-10
- 0.74.40 — 2026-09-10
- 0.74.39 — 2026-09-10
- 0.74.38 — 2026-09-10
- 0.74.37 — 2026-09-10
- 0.74.36 — 2026-09-10
- 0.74.35 — 2026-09-10
- 0.74.34 — 2026-09-10
- 0.74.33 — 2026-09-09
- 0.74.32 — 2026-09-09
- 0.74.31 — 2026-09-08
- 0.74.29 — 2026-09-07
- … 604 more at https://npm.io/package/@stacksjs/events/versions

## README

# Stacks Events

Functional event emitting.

## ☘️ Features

- Functional event emitting

## 🤖 Usage

```bash
bun install -d @stacksjs/events
```

Now, you can use it in your project:

```js
import { all, dispatch, listen, off } from '@stacksjs/events'

// listen to an event
listen('foo', e => console.log('foo', e))

// listen to all events
listen('*', (type, e) => console.log(type, e))

// fire an event
dispatch('foo', { a: 'b' })

// clearing all events
all.clear()

// working with handler references:
function onFoo() {}
listen('foo', onFoo) // listen
off('foo', onFoo) // unlisten
```

To view the full documentation, please visit [<https://stacksjs.com/event>s](https://stacksjs.com/events).

## 🧪 Testing

```bash
bun test
```

## 📈 Changelog

Please see our [releases](https://github.com/stacksjs/stacks/releases) page for more information on what has changed recently.

## 🚜 Contributing

Please review the [Contributing Guide](https://github.com/stacksjs/contributing) for details.

## 🏝 Community

For help, discussion about best practices, or any other conversation that would benefit from being searchable:

[Discussions on GitHub](https://github.com/stacksjs/stacks/discussions)

For casual chit-chat with others using this package:

[Join the Stacks Discord Server](https://stacksjs.com/discord)

## 🙏🏼 Credits

Many thanks to the following core technologies & people who have contributed to this package:

- [mitt](https://github.com/developit/mitt)
- [Chris Breuer](https://github.com/chrisbbreuer)
- [All Contributors](../../contributors)

## 📄 License

The MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/stacks/tree/main/LICENSE.md) for more information.

Made with 💙

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