A tiny, lightweight message bus for JavaScript applications with a wildcard listener and TypeScript support.
Nanobus is a tiny message bus library for JavaScript that provides event emitter functionality with a minimal footprint. It solves the need for a lightweight alternative to Node.js's EventEmitter, especially when wildcard event listeners or smaller bundle sizes are required. The library maintains compatibility with familiar EventEmitter APIs while adding specific features like a catch-all '*' listener.
JavaScript developers building lightweight applications, libraries, or frameworks where bundle size matters, and those who need wildcard event listeners not available in native Node.js EventEmitter.
Developers choose Nanobus for its extreme minimalism—it's about one-third the size of Node.js EventEmitter—while still offering useful features like wildcard listeners and TypeScript support. It's ideal when every kilobyte counts or when you need more control over event handling patterns.
🚎 - Tiny message bus
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
At about one-third the size of Node.js EventEmitter, it drastically reduces bundle size, making it ideal for performance-critical web applications where every kilobyte counts.
The '*' listener allows capturing all emitted events for debugging or logging, a feature not available in the native EventEmitter, as highlighted in the README.
Optional event typing enables better type safety and developer experience in TypeScript projects, with clear examples in the README for defining event signatures.
Maintains compatibility with Node.js EventEmitter methods like on, emit, and removeListener, reducing the learning curve for developers already accustomed to event-driven patterns.
Events are emitted synchronously, which can block the event loop and requires additional libraries like nanotick for asynchronous handling, as admitted in the FAQ.
Lacks advanced features such as error event handling, max listeners, or event cancellation, making it unsuitable for complex event systems that need robust management.
As a niche minimalist library, it doesn't have a wide range of plugins, extensions, or community support compared to more established alternatives like EventEmitter.