Mubsub is a pub/sub implementation for Node.js and MongoDB using capped collections and tailable cursors. Version 1.4.0 is the latest stable release (no updates since 2016). It allows publishing events to channels backed by capped collections and subscribing with optional event filtering. Compared to other MongoDB pub/sub libraries, it directly leverages MongoDB's native tailable cursors for low-latency message delivery. It is lightweight but lacks modern MongoDB driver support and TypeScript types. Suitable for simple pub/sub within a MongoDB environment.
npm install mubsubNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage: create a client, create a channel with options, subscribe to events, publish, then close.
Limit the number of channels; consider using event names to filter within a single channel instead.
Avoid dropping channels while publishing; use a controlled shutdown.
Consider using a more modern pub/sub library or pinning an old mongodb driver version (e.g., 2.x).
npm install mongodb
Use `const mubsub = require('mubsub')` then `const client = mubsub(uri)`