Ratbird is a transport agnostic notification system for Node. It provides tools for dispatching notifications to a given target based on configurable preferences.
Install using Node Package Manager:
npm install ratbird
Create a notifier and dispatch notifications (see Configuration and Preferences below):
var ratbird = ;var notifier = ratbird;notifier;
You can also create a stream that will dispatch notifications as they are written to the stream.
var dispatcher = ratbird;dispatcher;
There are two distinct configurable objects needed for Ratbird to operate. The
config and the
config object is needed to create a
Notifier and contains the setup
information needed for each dispatcher:
sms:accountSid: ''authToken: ''senderTel: '+15555555555'email:user: ''pass:''host: ''port: ''secure: truefrom: ''http:url: ''desktop:dgram:
prefs object is needed to tell the dispatcher how to delvier a
notification. This is supplied with every call to
dispatch(). If you are
using Mongoose, you can use
mongoose-ratbird to add
these preferences to your schemas.
sms: disabled: Boolean tel: Numberemail: disabled: Boolean address: Stringdesktop: disabled: Booleanhttp: disabled: Boolean url: Stringdgram: disabled: Boolean host: String port: Number