Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pub-once-sub

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pub-once-sub - npm Package Compare versions

Comparing version 0.6.0 to 0.7.0

12

example/example.js

@@ -5,2 +5,3 @@ var PubSub = require('../');

pubSub.subscribe('test');
pubSub.subscribe('test2');

@@ -10,3 +11,11 @@ pubSub.publish('test', 'one');

pubSub.publish('test', 'three');
pubSub.publish('test2', 'test2');
pubSub.on('test2', function(data) {
pubSub.publish('test', '2');
pubSub.publish('test', '3');
pubSub.publish('test', '7');
console.log(data);
});
pubSub.on('test', function(data) {

@@ -18,6 +27,7 @@ console.log(data);

pubSub2.subscribe('test');
pubSub2.subscribe('test2');
pubSub2.on('test', function(data) {
pubSub2.on('test2', function(data) {
console.log(data);
});

@@ -16,2 +16,6 @@ var EventEmitter = require('events').EventEmitter;

this.on('error', function(error) {
console.log(error);
});
var self = this;

@@ -21,4 +25,9 @@

self.redis.blpop(channel, 0, function(err, res) {
console.log(res);
if (res) {
self.emit(channel, message);
try {
self.emit(channel, res[1]);
} catch (error) {
self.emit('error', error);
}
}

@@ -44,3 +53,3 @@ });

var self = this;
self.redis.lpush(channel, message, function(err, res) {
self.redis.rpush(channel, message, function(err, res) {
self.pub.publish(channel, message);

@@ -47,0 +56,0 @@ });

2

package.json
{
"name": "pub-once-sub",
"version": "0.6.0",
"version": "0.7.0",
"description": ".",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc