API Reference

mitt

Tiny 200b event emitter library for JavaScript with no dependencies and clean API.

Official Documentation ↗
CompatibilityThis documentation covers version v3.0.1. Check the official docs for the latest API surface.

Installation

npmnpm install mitt
pnpmpnpm add mitt

Methods

mitt is tiny 200b event emitter library for JavaScript with no dependencies and clean API.

Key Features

  • data-fetching: Designed for data fetching scenarios with a focused API surface.

Installation

npm install mitt

Usage

API reference evidence

Fetched from official sources on 2026-11-08T18:20:00+08:00 via WebFetch https://raw.githubusercontent.com/developit/mitt/main/src/index.ts;WebFetch https://raw.githubusercontent.com/developit/mitt/main/README.md.

FAQ

Is mitt synchronous?
Yes, event emission and handler invocation are synchronous. Handlers run in registration order.
Can I remove all listeners for one event type?
Yes, call off(type) without a handler, or use clear() to remove all listeners across all types.
Does mitt support wildcard events?
Most minimal emitters require exact type matching. Check the official docs for wildcard or glob support.