Nano Events is a minimalistic, high-performance event emitter library for JavaScript. Its goal is to provide the simplest possible API to add pub/sub capabilities (emitters and listeners) to any JS object or application, while keeping overhead and bundle size extremely small. Rather than offering many complex features, nanoevents focuses on the core primitives: creating an emitter, subscribing to named events, emitting events with arbitrary data, and unsubscribing. Because of its minimal API surface and implementation, it’s very easy to integrate into frontend or backend JS/TypeScript projects without introducing significant dependencies or weight. The simplicity reduces cognitive load: developers don’t need to read long docs or worry about advanced event semantics.
Features
- Very small footprint — minimal code and tiny bundle size compared to big event libraries
- Simple API: createNanoEvents() returns emitter with .on() and .emit() methods
- Lightweight subscription and clean unsubscription handling for memory-safe event use
- Framework-agnostic — works in Node.js or browser JS environments, plain JavaScript or TypeScript
- Instant integration into existing projects without heavy dependencies or configuration
- Good for simple pub/sub, reactive patterns, or bridging loose-coupled modules