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

amqp-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amqp-wrapper - npm Package Compare versions

Comparing version 3.0.1 to 3.1.0

2

amqp.js

@@ -82,2 +82,3 @@ var amqp = require('amqplib'),

exports.publishToQueue = function(name, message, callback) {
if (typeof message === 'object') message = JSON.stringify(message);
var publishQueue = _.find(queueParams.publish, {'name': name});

@@ -97,2 +98,3 @@ channel.publish(exchange, publishQueue.routingKey, new Buffer(message),

exports.publish = function(routingKey, message, options, callback) {
if (typeof message === 'object') message = JSON.stringify(message);
channel.publish(exchange, routingKey, new Buffer(message), options, callback);

@@ -99,0 +101,0 @@ };

2

package.json
{
"name": "amqp-wrapper",
"version": "3.0.1",
"version": "3.1.0",
"description": "A wrapper around https://github.com/squaremo/amqp.node to make consuming and publishing dead easy.",

@@ -5,0 +5,0 @@ "main": "amqp.js",

@@ -56,2 +56,4 @@ amqp-wrapper

AMQP.publish(routingKey, payload, done);
If `payload` is an object, it will be turned into JSON.
```

@@ -58,0 +60,0 @@

@@ -23,6 +23,3 @@ var SandboxedModule = require('sandboxed-module'),

]
}, function(err, res) {
if (err) return done(err);
done();
});
}, done);
});

@@ -39,3 +36,3 @@ it('should setup for publishing and consuming', function(done) {

]
}, function(err, res) {
}, function(err) {
if (err) return done(err);

@@ -61,6 +58,3 @@ expect(AMQP.getSetupFuncs().consume.calledOnce, 'setupForConsume()').to.

if (err) return done(err);
AMQP.publishToQueue('myqueue', new Buffer('test'), function(err) {
if (err) return done(err);
done();
});
AMQP.publishToQueue('myqueue', 'test', done);
});

@@ -74,8 +68,12 @@ });

if (err) return done(err);
AMQP.publish('myqueue', new Buffer('test'), {}, function(err) {
if (err) return done(err);
done();
});
AMQP.publish('myqueue', 'test', {}, done);
});
});
it('should accept objects', function(done) {
AMQP.connect('amqp://guest:guest@localhost', 'mytestexchange', {},
function(err, res) {
if (err) return done(err);
AMQP.publish('myqueue', {woo: 'test'}, {}, done);
});
});
});

@@ -82,0 +80,0 @@ describe('#consume', function() {

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