New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@modulus/rabbit-topics

Package Overview
Dependencies
Maintainers
7
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@modulus/rabbit-topics

amqplib wrapper for easier rabbitmq scripting of topics queue

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-40%
Maintainers
7
Weekly downloads
 
Created
Source

Rabbit-Topics

npm travis standard standard-readme compliant

amqplib wrapper for easier rabbitmq scripting of topics queue

Table of Contents

Installation

npm install @modulus/rabbit-topics

Usage

RabbitTopics(url, [options])

The exported function takes the same parameters as amqplib.connect, and returns a object with two exported functions, publish and subscribe.

Publish(exchange, topic, message, done)

Sends data to the topic exchange and yeilds

const Topics = require('@modulus/rabbit-topics')(url)

Topics.publish('tasks', 'servo.provision', { message: true }, (err) => {
  if (err) throw err // unable to publish

  console.log('message delivered')
})
Subscribe(exchange, topic, worker)

Consumes matching topic messages on the exchange

const Topics = require('@modulus/rabbit-topics')(url)

Topics.subscribe('tasks', 'servo.#', (message, done) => {
  // do work
  done(null, { result: true })
})

Contribute

Contributions welcome! Please read the contributing guidelines first.

License

MIT

Keywords

FAQs

Package last updated on 07 Oct 2016

Did you know?

Socket

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.

Install

Related posts

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