Socket
Socket
Sign inDemoInstall

mqemitter-mongodb

Package Overview
Dependencies
162
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mqemitter-mongodb

MongoDB based MQEmitter


Version published
Weekly downloads
364
increased by8.01%
Maintainers
1
Install size
12.6 MB
Created
Weekly downloads
 

Readme

Source

mqemitter-mongodb  Build Status

MongoDB powered MQEmitter.

See MQEmitter for the actual API.

js-standard-style

Install

$ npm install mqemitter-mongodb --save

Example

var mongodb = require('mqemitter-mongodb')
var mq = mongodb({
  url: 'mongodb://127.0.0.1/mqemitter?auto_reconnect'
})
var msg  = {
  topic: 'hello world',
  payload: 'or any other fields'
}

mq.on('hello world', function (message, cb) {
  // call callback when you are done
  // do not pass any errors, the emitter cannot handle it.
  cb()
})

// topic is mandatory
mq.emit(msg, function () {
  // emitter will never return an error
})

API

MQEmitterMongoDB([opts])

Create a new instance of mqemitter-mongodb.

Options:

  • url: a mongodb endpoint url
  • database: a mongodb database name, by default it comes from the uri
  • mongo: options for mongodb client
  • db: a db instance of mongodb (instead of url)

Acknowledgements

Code ported from Ascoltatori.

License

MIT

FAQs

Last updated on 06 Apr 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc