pipe-hermes
v1.0.3
Published
Simple pub sub messaging tool
Downloads
2
Readme
Hermes
A light weight message broker that uses the publisher and subscriber pattern to deliver messages within services.
Installation
Install pipe-hermes with npm
npm install pipe-hermes
Usage/Examples
import Hermes from 'pipe-hermes'
Subscriber
import { HermesSubscriber } from 'pipe-hermes'
const ApplicationConfig = {
host: 'broker.pipemessenger.xyz',
port: 5670,
hermesKey: '/*KEY USED BY THE ENIGMA CLI*/',
hermesToken: '/*GENERATED BY THE ENIGMA CLI*/'
};
const subscriber = new HermesSubscriber(ApplicationConfig);
subscriber.on('add-to-cart', (message) => {
console.log('Item added to cart:', message);
});
Publisher
import { HermesPublisher } from 'pipe-hermes'
const ApplicationConfig = {
host: 'broker.pipemessenger.xyz',
port: 5670,
hermesKey: '/*KEY USED BY THE ENIGMA CLI*/',
hermesToken: '/*GENERATED BY THE ENIGMA CLI*/'
};
const publisher = new HermesPublisher(ApplicationConfig);
publisher.deliver<string>('add-to-cart', 'Hello World!');
Documentation
Use the engima cli tool to generate your hermes token using your key
Tech Stack
Server: NodeJS, GoLang
🚀 About Me
I just write codes that give me headaches...