Pub/Sub message bus for JavaScript and TypeScript.
* matches a single topic segment, # matches zero or morenpm install postal
import { getChannel } from "postal";
const orders = getChannel("orders");
orders.subscribe("order.created", envelope => {
console.log("New order:", envelope.payload.orderId);
});
orders.publish("order.created", { orderId: "abc-123" });
For the full API — wildcards, RPC, wire taps, transports — see the docs.
Upgrading from v2? postal v3 is a ground-up rewrite with breaking changes to the module system, subscriber callbacks, envelope shape, and more. See the v2 → v3 migration guide before upgrading.
| Package | npm | Description |
|---|---|---|
| postal | postal |
Core message bus |
| postal-transport-messageport | postal-transport-messageport |
MessagePort transport for iframes and workers |
| postal-transport-broadcastchannel | postal-transport-broadcastchannel |
BroadcastChannel transport for cross-tab messaging |
| postal-transport-serviceworker | postal-transport-serviceworker |
ServiceWorker transport — dedicated MessagePort per tab, presence tracking, SW restart resilience |
| postal-transport-childprocess | postal-transport-childprocess |
child_process/cluster IPC transport for Node.js |
pnpm install # Install dependencies
pnpm build # Build all packages
pnpm test # Run all tests
pnpm lint # Lint all packages
pnpm run checks # lint + test + build (CI gate)
MIT
$ claude mcp add postal.js \
-- python -m otcore.mcp_server <graph>