Mubsub is a pub/sub implementation for Node.js using MongoDB capped collections and tailable cursors. This fork (mubsub-nbb, published as @nodebb/mubsub) updates the original package for compatibility with mongodb 3.x driver. Version 1.6.1 is the latest stable release, maintained sporadically by NodeBB. It allows publishing events as documents into capped collections and supports event filtering via MongoDB queries. Key differentiators: leverages MongoDB's native tailable cursors for real-time notifications, supports flexible channel configuration (size, max, retry interval), and does not require additional infrastructure beyond MongoDB.
npm install mubsub-nbbNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating a client, subscribing to events, publishing messages, and closing the connection.
npm install @nodebb/mubsub
Switch to '@nodebb/mubsub'.
Ensure channels are only deleted when no publishers are active.
Limit the number of channels to avoid performance degradation.
Run: npm install @nodebb/mubsub and import using: import mubsub from '@nodebb/mubsub';
Ensure the MongoDB connection URI points to a database that exists and has write permissions.
Wait for the client 'connect' event or ensure MongoDB is reachable.