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

vubsub

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vubsub - npm Package Compare versions

Comparing version 1.0.9 to 1.1.0

.npmignore

42

lib/channel.js

@@ -86,7 +86,7 @@ var util = require('util')

if (err) {
console.error('Channel_handleNext', self.name, err);
console.error('Channel._handleNext', self.name, err);
self._close();
self.emit('close', { reason: "error" });
} else if (!data) {
console.warn('Channel_handleNext', self.name, "no data");
console.warn('Channel._handleNext', self.name, "no data");
self._close();

@@ -114,14 +114,32 @@ self.emit('close', { reason: "no_data" });

var d = q.defer();
db.createCollection('ns_' + namespace, {
size: Channel.COLLECTION_SIZE,
capped: true,
autoIndexId: true
}, function(err, collection) {
if (err) {
d.reject(err);
} else if (!collection) {
d.reject(new Error('failed to create a new namespace collection'));
var name = 'ns_' + namespace;
db.collection(name, { strict: true }, function(err, collection) {
if (err || !collection) {
console.warn('Channel.collection', 'trying to create namespace collection', name);
db.createCollection(name, {
size: Channel.COLLECTION_SIZE,
capped: true,
autoIndexId: true
}, function(err, collection) {
if (err) {
console.error('Channel.collection', 'failed to create namespace collection', name);
d.reject(err);
} else if (!collection) {
console.error('Channel.collection', 'failed to get namespace collection', name);
d.reject(new Error('failed to create a new namespace collection'));
} else {
collection.insert({ init: true }, { w: 1 }, function(err, bootstrap) {
if (err || !bootstrap) {
console.error('Channel.collection', 'failed to bootstrap namespace collection', name);
d.reject(new Error('failed to create bootstrap namespace collection'));
} else {
d.resolve(collection);
}
});
}
});
} else {
d.resolve(collection);
}
}
});

@@ -128,0 +146,0 @@ return d.promise.nodeify(cb);

{
"name": "vubsub",
"version": "1.0.9",
"version": "1.1.0",
"description": "Pub/Sub for Node.js and MongoDB",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/vivocha/vubsub",

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