@cotton-tail-tech/simple-redis-stream

1.0.2 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @cotton-tail-tech/simple-redis-stream

Weekly Downloads

0

Version

1.0.2

License

The Unlicense

Unpacked Size

5.85 kB

Total Files

7

Last publish

Collaborators

  • domiibunni