
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@package/pubsub
Advanced tools
wrapper around amqplib to help expediate basic stuffs.
>$ npm install @package/pubsub
@package/pubsub>$ npm test
if you want to convert @package/pubsub into es5, you can simply run:
@package/pubsub>$ npm run build
creates a connection.
import {create_connection} from '@package/pubsub';
// use an alternate port
let conn = yield create_connection({ port : 5673 });
create a channel, assert passed queues in handlers Object into existence and add their callbacks — if any — as consumers.
import {create_connection, init_channel} from '@package/pubsub';
let conn = yield create_connection;
let channel = yield init_channel(conn, {
// assert queue into existence and consume any messages published to it
'queue.name.1' : function* (channel, msg) {
let data = msg.content.toString();
console.log(msg);
// if you want to remove this message from the queue
channel.ack(data);
},
// assert queue into existence only
'queue.name.2' : true
});
broadcast a message to the passed queue.
import {create_connection, init_channel, broadcast} from '@package/pubsub';
let conn = yield create_connection;
let channel = yield init_channel(conn, {
'queue.name.1' : function* (channel, msg) {
let data = JSON.parse(msg.content.toString());
let res = yield doSomethingTo(data);
channel.ack(msg);
// broadcast the new message to a different queue
yield broadcast(channel, 'queue.name.2', res);
},
'queue.name.2' : true
});
remove the passed queues, will not throw an Error if a queue does not exist.
import {conn, destroy_queue} from '@package/pubsub';
let conn = yield create_connection;
yield destroy_queue(conn, 'queue.name.1', 'queue.name.2');
FAQs
easy peasy rabbitmq
We found that @package/pubsub demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.