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

@thecolvinco/nodejs-amqplib

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thecolvinco/nodejs-amqplib - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

2

package.json
{
"name": "@thecolvinco/nodejs-amqplib",
"description": "RabbitMQ abstraction with some utils",
"version": "0.0.7",
"version": "0.0.8",
"source": "src/main.ts",

@@ -6,0 +6,0 @@ "main": "dist/main.umd.js",

@@ -8,3 +8,3 @@ # Colvin nodejs rabbitmq utils

```javascript
import { amqpConnect, retryable, worker, deadLetter } from '@thecolvinco/nodejs-amqplib';
import { amqpConnect, retryable, worker, deadLetter, toJSON } from '@thecolvinco/nodejs-amqplib';

@@ -21,6 +21,6 @@ const connectionString = 'amqp://rabbitmq:rabbitmq@localhost:5672';

return async (msg) => {
console.info(`Message received ${msg}`);
const payload = toJSON(msg).payload;
// Simulate some retryables
if (msg.content.toString() === 'retry') {
if (payload === 'retry') {
await retryable({

@@ -98,3 +98,3 @@ channel,

```javascript
import { amqpConnect, producer } from '@thecolvinco/nodejs-amqplib';
import { amqpConnect, producer, createEvent } from '@thecolvinco/nodejs-amqplib';

@@ -107,5 +107,2 @@ const connectionString = 'amqp://rabbitmq:rabbitmq@localhost:5672';

const channel = await conn.createChannel();
const message = args[0] || 'Hello world';
const key = args[1] || 'blom.superapp.1.event.shopify.order-created';
const exchange = {

@@ -115,2 +112,14 @@ name: 'blom.exchange.topic',

};
const messageBody = createEvent({
payload: args[0] || 'Hello world',
meta: {
company: 'blom',
context: 'superapp',
version: 1,
entity: 'shopify',
name: args[1] || 'order-created',
},
});
const key = messageBody.name;
const message = JSON.stringify(messageBody);

@@ -117,0 +126,0 @@ await producer({

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