finds.dev

developit/mitt

🥊 Tiny 200 byte functional event emitter / pubsub.

View on GitHubHomepage ↗

★ 11,890TypeScriptMITupdated Aug 2024

// the take

Mitt is a 200-byte event emitter that covers the basic on/off/emit pattern with a wildcard listener for all events. It's for anyone who needs simple pubsub in a browser or Node context without pulling in a heavier dependency. The TypeScript generics for event maps are a genuine selling point for typed projects.

The typed event map API is well-designed — you define your event schema once and get type errors at the emit and handler sites. The wildcard '*' handler is genuinely useful for debugging or middleware-style logging without monkey-patching. Methods don't rely on 'this', so you can destructure or pass them around without binding. At 200 bytes gzipped, it won't show up in any bundle analysis.

No once() method — you have to wrap off() manually, which is tedious and easy to get wrong. No error handling: if a handler throws, it propagates synchronously and blows up remaining handlers in the queue. No priority or ordering guarantees, which matters when you need initialization order to be predictable. The project has had essentially no commits since mid-2024 and the issue tracker has open feature requests that aren't being addressed.

We read the README, the directory tree and a key source file in July 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
11,890
Forks
484
Language
TypeScript
License
MIT
Last commit
14 Aug 2024

// nearby

If mitt isn't quite it.

All repos →