Have ideas to improve npm?Join in the discussion! »

    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

    0

    Version

    0.0.5

    License

    MIT

    Last publish

    Collaborators

    • avatar