# nanoevents

> Simple and tiny (108 bytes) event emitter library

Latest version **10.0.0** (published 2026-07-22) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 10.0.0 |
| Published | 2026-07-22 |
| First published | 2016-09-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | ^22.0.0 \|\| ^24.0.0 \|\| >=26.0.0 |
| Dependencies | 0 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1634 |
| Author | Andrey Sitnik |
| Maintainers | ai |
| Keywords | EventEmitter, Events, emit, emitter, event, pub/sub, publish, reactor, subscribe |

## Links

- npm: https://www.npmjs.com/package/nanoevents
- Repository: https://github.com/ai/nanoevents
- Homepage: https://github.com/ai/nanoevents#readme
- Issues: https://github.com/ai/nanoevents/issues
- Funding: https://github.com/sponsors/ai
- npm.io page: https://npm.io/package/nanoevents

## 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

- 10.0.0 (latest) — 2026-07-22
- 9.1.0 — 2024-10-14
- 9.0.0 — 2023-11-23
- 8.0.0 — 2023-07-01
- 7.0.1 — 2022-06-16
- 7.0.0 — 2022-06-16
- 6.0.2 — 2021-10-17
- 6.0.1 — 2021-09-04
- 6.0.0 — 2021-04-24
- 5.1.13 — 2021-03-15
- 5.1.12 — 2021-03-03
- 5.1.11 — 2021-02-16
- 5.1.10 — 2020-10-23
- 5.1.9 — 2020-10-23
- 5.1.8 — 2020-06-13
- … 30 more at https://npm.io/package/nanoevents/versions

## README

# Nano Events

Simple and tiny event emitter library for JavaScript.

- Only **108 bytes** (minified and brotlied).
  It uses [Size Limit] to control size.
- The `on` method returns `unbind` function. You don’t need to save
  callback to variable for `removeListener`.
- TypeScript and ES modules support.
- No aliases, just `emit` and `on` methods.
  No Node.js [EventEmitter] compatibility.

```js
import { createNanoEvents } from 'nanoevents'

const emitter = createNanoEvents()

const unbind = emitter.on('tick', volume => {
  summary += volume
})

emitter.emit('tick', 2)
summary //=> 2

unbind()
emitter.emit('tick', 2)
summary //=> 2
```

[EventEmitter]: https://nodejs.org/api/events.html
[Size Limit]: https://github.com/ai/size-limit

---

<img src="https://cdn.evilmartians.com/badges/logo-no-label.svg" alt="" width="22" height="16" />  Made at <b><a href="https://evilmartians.com/devtools?utm_source=nanoevents&utm_campaign=devtools-button&utm_medium=github">Evil Martians</a></b>, product consulting for <b>developer tools</b>.

---

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