Nascent Personality Manifestation

npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

heroku-bus-client

0.0.5 • Public • Published

Heroku bus client

Node.JS client for Heroku Bus server (https://github.com/YaroslavGaponov/heroku-bus-server)

Example

Publisher

var Client = require('heroku-bus-client');
 
var publisher = new Client('http://stormy-gorge-8934.herokuapp.com');
 
publisher.send('topic', 'test', { "time": Date(), 'message': process.argv[2] || 'Hello from Ukraine!!!' });
 

Subscriber

 
var Client = require('heroku-bus-client');
 
var subscriber = new Client('http://stormy-gorge-8934.herokuapp.com');
 
subscriber.subscribe('topic', 'test');
 
subscriber.on('message', function(message) {
    console.log(message);
});
 
subscriber.on('error', function(error) {
    console.log(error);
});

Keywords

install

npm i heroku-bus-client

Downloadsweekly downloads

5

version

0.0.5

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability