Socket
Socket
Sign inDemoInstall

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.1.0 to 3.2.0

lol

1

API.md

@@ -54,2 +54,3 @@ - [`Create(amqpUrl)`](#createamqpurl---amqp)

Defaults to an empty object
- `parse`: (function) parse string content of message. Defaults to `JSON.parse`
- `prefetch`: (number) of messages to fetch when consuming. Defaults to `1`

@@ -56,0 +57,0 @@ - `queue`: (string) name of the queue to use

5

index.js

@@ -43,2 +43,3 @@ 'use strict';

exchangeOptions: {durable: true},
parse: JSON.parse,
queueOptions: {durable: true},

@@ -85,6 +86,6 @@ prefetch: 1

try {
msg.json = JSON.parse(msg.content.toString());
msg.json = options.parse(msg.content.toString());
return handler(msg, ch);
} catch (err) {
console.error('Error converting AMQP message content to JSON.', err);
console.error('Error deserializing AMQP message content.', err);
}

@@ -91,0 +92,0 @@ };

{
"name": "amqplib-easy",
"version": "3.1.0",
"version": "3.2.0",
"description": "Simplified API for interacting with AMQP",

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

amqplib-easy
============
[![Build Status](https://travis-ci.org/lanetix/node-lanetix-amqp-easy.svg?branch=api-doc)](https://travis-ci.org/lanetix/node-lanetix-amqp-easy)
[![Build Status](https://travis-ci.org/lanetix/node-lanetix-amqp-easy.svg?branch=master)](https://travis-ci.org/lanetix/node-lanetix-amqp-easy)

@@ -5,0 +5,0 @@ [amqplib](https://github.com/squaremo/amqp.node) but easy! Let us manage your

@@ -43,2 +43,27 @@ /*globals it:false*/

it('should accept alternate parser', function (done) {
amqp.consume(
{
exchange: 'cat',
parse: function () { return { name: 'Fred' }; },
queue: 'found_cats',
topics: [ 'found.*' ]
},
function (cat) {
var name = cat.json.name;
try {
name.should.equal('Fred');
done();
} catch (err) { done(err); }
}
)
.then(function (c) {
cancel = c;
return BPromise.all([
amqp.sendToQueue({ queue: 'found_cats' }, new Buffer('dsadasd'))
]);
})
.catch(done);
});
it('should handle buffers reasonably', function (done) {

@@ -45,0 +70,0 @@ var catCount = 0;

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