1.5.2 • Published 2 years ago

catch-messaging v1.5.2

Weekly downloads
3
License
ISC
Repository
github
Last release
2 years ago

Catch Messaging

Publish messages and subscribe to message channels on Catch Service Management Gateways.

Requirements

This package uses (redis)https://redis.io pubsub for messaging and requires a local redis instance to be running.

Usage

npm i catch-messaging

var Messaging = require('catch-messaging');
const serviceName = 'Messaging Test';
const debug = true;

// Sample commands for testing.
var serviceCommands = [
  {
    endWith: "none",
    useHex: false,
    channel: "connect",
    pattern: "connect"
  }
];

// Sample responses for testing.
var serviceResponses = [
  {
    endWith: "none",
    useHex: false,
    useRegularExpression: false,
    channel: "messaging tester.connected",
    pattern: "connected",
    persist: false
  }
]

messaging = new Messaging(serviceName, serviceCommands, serviceResponses, debug, (message) => {
  console.log('New message received: ' + message);
  if(message === 'connect'){
    connect();
  }
});

function connect(){
  messaging.publish('connected');
}
1.5.2

2 years ago

1.5.0

3 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago