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

amqplib-easy

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amqplib-easy - npm Package Compare versions

Comparing version 3.0.2 to 3.1.0

4

API.md

@@ -27,2 +27,4 @@ - [`Create(amqpUrl)`](#createamqpurl---amqp)

[amqplib](http://www.squaremobius.net/amqp.node/doc/channel_api.html#toc_60).
If message is a `Buffer`, it is sent as is, otherwise, it is serialized to JSON
and sent.

@@ -33,2 +35,4 @@ ### `AMQP.sendToQueue(config, message, [options])` -> `Promise`

[amqplib](http://www.squaremobius.net/amqp.node/doc/channel_api.html#toc_60).
If message is a `Buffer`, it is sent as is, otherwise, it is serialized to JSON
and sent.

@@ -35,0 +39,0 @@ ### `AMQP.connect()` -> `Promise`

@@ -22,2 +22,9 @@ 'use strict';

function toBuffer(obj) {
if (obj instanceof Buffer) {
return obj;
}
return new Buffer(JSON.stringify(obj));
}
diehard.register(cleanup);

@@ -136,3 +143,3 @@

key,
new Buffer(JSON.stringify(json)),
toBuffer(json),
messageOptions || queueConfig.messageOptions || {persistent: true});

@@ -153,3 +160,3 @@ });

queueConfig.queue,
new Buffer(JSON.stringify(json)),
toBuffer(json),
messageOptions || queueConfig.messageOptions || {persistent: true}

@@ -156,0 +163,0 @@ );

6

package.json
{
"name": "amqplib-easy",
"version": "3.0.2",
"version": "3.1.0",
"description": "Simplified API for interacting with AMQP",
"main": "index.js",
"engines": {
"node": ">=0.10",
"npm": "^2"
},
"scripts": {

@@ -11,0 +7,0 @@ "lint": "eslint --ignore-path .gitignore .",

@@ -34,3 +34,3 @@ /*globals it:false*/

describe('should publish, sendToQueue and receive', function () {
describe('', function () {
var cancel;

@@ -44,3 +44,3 @@

it('', function (done) {
it('should handle buffers reasonably', function (done) {
var catCount = 0;

@@ -68,2 +68,32 @@ amqp.consume(

return BPromise.all([
amqp.publish({ exchange: 'cat' }, 'found.tawny', new Buffer('{ "name": "Sally" }')),
amqp.sendToQueue({ queue: 'found_cats' }, new Buffer('{ "name": "Fred" }'))
]);
})
.catch(done);
});
it('should publish, sendToQueue and receive', function (done) {
var catCount = 0;
amqp.consume(
{
exchange: 'cat',
queue: 'found_cats',
topics: [ 'found.*' ]
},
function (cat) {
var name = cat.json.name;
try {
/*eslint-disable no-unused-expressions*/
(name === 'Sally' || name === 'Fred').should.be.ok;
/*eslint-enable no-unused-expressions*/
if (++catCount === 2) {
done();
}
} catch (err) { done(err); }
}
)
.then(function (c) {
cancel = c;
return BPromise.all([
amqp.publish({ exchange: 'cat' }, 'found.tawny', { name: 'Sally' }),

@@ -70,0 +100,0 @@ amqp.sendToQueue({ queue: 'found_cats' }, { name: 'Fred' })

@@ -16,2 +16,2 @@ 'use strict';

diehard.listen({timeout: 8000});
diehard.listen();

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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