pubnub-events
v0.0.2
Published
Send PubNub messages on NodeJS events.
Downloads
2
Maintainers
Readme
pubnub-events
Send PubNub messages on NodeJS events.
This module provides an alternative EventEmitter (default in NodeJS) that sends
Installation
$ npm install --save pubnub-events
Usage
var PubNubEvents = require('pubnub-events');
var myEventEmitter = new PubNubEvents({
publish_key: 'pub-c-8e6ce779-896f-4c35-a786-46ad43d20e99',
subscribe_key: 'sub-c-21ad773a-35cb-11e6-ac64-0619f8945a4f',
channel: 'button1',
device: 'edison'
});
myEventEmitter.on('something', function () {
console.log('should have emmited something');
});
myEventEmitter.emit('something', 'another thing'); --> this will trigger the pubnub event
myEventEmitter.mutePubNub();
myEventEmitter.emit('something', 'another thing'); --> this will NOT trigger the pubnub event
License
MIT © Diego Pamio