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

@twilson63/palmetto-rmq

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@twilson63/palmetto-rmq - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

.travis.yml

4

index.js
var EventEmitter = require('events').EventEmitter
var ee = new EventEmitter()
var servicebus = require('servicebus')
module.exports = function (config) {

@@ -10,3 +10,3 @@ // validate config

var bus = require('servicebus').bus({
var bus = servicebus.bus({
url: config.endpoint,

@@ -13,0 +13,0 @@ vhost: config.vhost || null

{
"name": "@twilson63/palmetto-rmq",
"version": "1.0.4",
"version": "1.0.5",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "tap test"
},

@@ -13,3 +13,4 @@ "keywords": [],

"devDependencies": {
"tap": "^1.1.0"
"rewire": "^2.3.3",
"tap": "^1.2.0"
},

@@ -16,0 +17,0 @@ "dependencies": {

@@ -5,2 +5,4 @@ # Palmetto RMQ

[![Build Status](https://travis-ci.org/twilson63/palmetto-rmq.svg?branch=master)](https://travis-ci.org/twilson63/palmetto-rmq)
## usage

@@ -7,0 +9,0 @@

var test = require('tap').test
var pr = require('../')
var rewire = require('rewire')
var palmetto = rewire('../')
test('publish', function (t) {
var ee = pr({
palmetto.__set__('servicebus', {
bus: function () {
return {
subscribe: function() {},
publish: function (n, e) {
t.equals(n, 'foo', 'should equal app name')
t.deepEquals(e, { to: 'widget.request.create', name: 'foobar'}, 'should equal object')
}
}
}
})
var ee = palmetto({
endpoint: 'amqp://guest:guest@localhost:5672',

@@ -7,0 +21,0 @@ app: 'foo'

var test = require('tap').test
var pr = require('../')
var rewire = require('rewire')
var palmetto = rewire('../')
test('subscribe', function (t) {
var ee = pr({
palmetto.__set__('servicebus', {
bus: function () {
return {
subscribe: function(n, fn) {
setTimeout(function () {
fn({ to: 'foo.bar', from: 'beepboop' })
}, 50)
},
publish: function () {}
}
}
})
var ee = palmetto({
endpoint: 'amqp://guest:guest@localhost:5672',
app: 'foo'
})
var msg = { to: 'widget.request.create', name: 'foobar'}
ee.on(msg.to, function (event) {
console.log(event)
console.log('notified')
ee.on('foo.bar', function (event) {
t.equals(event.to, 'foo.bar')
t.equals(event.from, 'beepboop')
t.end()
})
setTimeout(function() {
ee.emit('send', msg)
console.log('sent')
}, 500)
})
})
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