Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. choo
  3. nanobus

nanobus

MITJavaScriptv4.4.0

A tiny, lightweight message bus for JavaScript applications with a wildcard listener and TypeScript support.

GitHubGitHub
227 stars20 forks0 contributors

What is nanobus?

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.

Target Audience

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.

Value Proposition

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.

Overview

🚎 - Tiny message bus

Use Cases

Best For

  • Adding event-driven architecture to lightweight JavaScript libraries
  • Implementing a minimal message bus in small to medium-sized applications
  • Debugging applications by logging all events with a wildcard listener
  • Reducing bundle size in projects where Node.js EventEmitter is too heavy
  • Building modular UI frameworks that require component communication
  • Creating TypeScript applications with typed event systems

Not Ideal For

  • Applications requiring asynchronous event handling to avoid blocking the main thread
  • Projects needing advanced event emitter features like error events or listener count limits
  • Pure Node.js environments where the built-in EventEmitter is sufficient and a wildcard listener isn't needed

Pros & Cons

Pros

Extremely Small Size

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.

Wildcard Listener Support

The '*' listener allows capturing all emitted events for debugging or logging, a feature not available in the native EventEmitter, as highlighted in the README.

TypeScript Typing

Optional event typing enables better type safety and developer experience in TypeScript projects, with clear examples in the README for defining event signatures.

Familiar API

Maintains compatibility with Node.js EventEmitter methods like on, emit, and removeListener, reducing the learning curve for developers already accustomed to event-driven patterns.

Cons

Synchronous Event Emission

Events are emitted synchronously, which can block the event loop and requires additional libraries like nanotick for asynchronous handling, as admitted in the FAQ.

Limited Feature Set

Lacks advanced features such as error event handling, max listeners, or event cancellation, making it unsuitable for complex event systems that need robust management.

Minimal Ecosystem

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.

Frequently Asked Questions

Quick Stats

Stars227
Forks20
Contributors0
Open Issues3
Last commit5 years ago
CreatedSince 2017

Tags

#event-bus#lightweight#choojs#nodejs#typescript#micro-library#javascript#message-bus#event-emitter

Built With

J
JavaScript
T
TypeScript

Included in

choo201
Auto-fetched 19 hours ago

Related Projects

hyperxhyperx

🏷 - tagged template string virtual dom builder

Stars1,017
Forks46
Last commit2 years ago
nanomorphnanomorph

🚅 - Hyper fast diffing algorithm for real DOM nodes

Stars753
Forks57
Last commit5 years ago
belbel

:dragon: HTML template strings for the Browser with support for Server Side Rendering in Node.

Stars688
Forks48
Last commit3 years ago
nanorouternanorouter

🛤 - Small frontend router

Stars117
Forks12
Last commit7 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub