@cotton-tail-tech/simple-redis-stream
v1.0.2
Published
Simple Redis pub-sub module with topic subscription
Downloads
2
Readme
Simple Redis Stream
Installation
To install the necessary dependencies, execute the following command:
npm i @cotton-tail-tech/simple-redis-stream
Usage
Import
Import the module into your Node.js application:
const srs = require("@cotton-tail-tech/simple-redis-stream");
Initialization
Initialize the Redis connection with the following parameters:
srs.init({
host: "localhost",
port: 6379,
});
Subscribe to Events
Subscribe to specific events by providing the event name and a callback function to handle incoming messages:
srs.subscribe("zendesk_api_create", (message) => {
console.log(message);
});
Publish Events
Publish events to the Redis stream with a designated event name and associated data:
srs.publish("zendesk_api_create", { id: 1, name: "test" });
This readme provides a concise overview of how to set up and utilize the Simple Redis Stream module for integrating Redis streams into your Node.js applications.