Postboy — a typed message bus for TypeScript
Postboy is a lightweight, framework-agnostic message bus for TypeScript applications. It replaces scattered service calls and deep component chains with a single typed bus: parts of your application exchange typed messages instead of calling each other, so the code stays decoupled and predictable as it grows.
The sole runtime dependency is RxJS (^7).
What you get
Capability | How |
|---|---|
Publish/subscribe |
|
Async request/response |
|
Synchronous commands |
|
Cross-cutting concerns | staged middleware with cancellation |
Lifecycle management | registrators and namespaces that tear down registrations in one call |
Testability | the postboy-testing BDD toolkit |
A companion package, @artstesh/postboy-testing, provides a recording mock and fluent assertions for testing postboy-based code.
A taste of Postboy
Every message class declares its own unique static readonly ID — that string, not the class identity, is the routing key. It is the one rule that explains most of Postboy's behavior; see How it works.
Where to go next
New here? Follow the Quick Start.
Installing into a project? See Installation.
Want the mental model first? Read Concepts.
Migrating from 3.4? Read Versions and Migrating middleware from 3.4.
Looking for a specific signature? Use the API reference.