npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

eventbus-prodio

v1.0.0

Published

EventBus based on Google Pub/Sub

Downloads

5

Readme

EventBus

License: MIT

EventBus is a nodejs wrapper to communicate with Google Pub/Sub.

  • Simple API's to publish and subscribe,
  • etc.

New Features!

  • You can publish message to any topic
  • Subscribe to any subscription ( For now, limited to only single subscription )

You can also:

  • Check subscription status
  • Unsubscribe with a single API
  • Create multiple instances of event bus

Goal

Expose simple API's for communication with Google Pub/Sub

Prerequisites

Installation

EventBus-Prodio requires Node.js v6+ to run.

Install the dependencies and devDependencies and start the server.

$ git clone https://github.com/ProdioDesignWorks/EventBus.git
$ cd EventBus
$ npm install

For production environments...

$ npm install EventBus-Prodio --save

Plugins

EventBus-Prodio is extended with the following plugins. Instructions on how to use them in your own application are linked below.

| Plugin | README | | ------ | ------ | | Google PubSub | PubSub GitHub |

How to use

const EventBus = require('EventBus-Prodio');
// google config file
const Bus = new EventBus({ 
    projectId: 'projectId', 
    keyFilename: 'projectId-keyFile.json' 
});

For Subscribing to a subscription

const subscriptionName = "subscriptionName";
const autoAck = true;
//If autoAck is set, then message's are auto acknowledged as soon as message is received
//If autoAck is not set, then subscriber has to explicitly acknowledge the message

const onMessage = (message) => console.log(message);
Bus.subscribe({ subscriptionName, autoAck }, onMessage);

For Publishing message on topic

const topicName = "topicName";
const message = "User registered";
const customAttributes = {
    serviceId: 'REGISTRATION-SERVICE',
    user: { 
        name: 'John Doe',
        email: '[email protected]'
    }
};

//async await 
const messageId = await Bus.publish(topicName, msg, customAttributes);

//promise
Bus.publish(topicName, msg, customAttributes).then(
    messageId => console.log(messageId) 
).catch(
    error => console.error(error)
);

Please refer examples for more details

Development

Want to contribute? Great!

EventBus-Prodio uses Babel + Eslint for fast developing. Make a change in your file and instantanously see your updates!

Open your favorite Terminal and run these commands.

Todos

  • Write MORE Tests
  • Add multiple subscriptions support
  • Create Topic & Subscription API's
  • Ordered events

License

MIT

Free Software, Hell Yeah!