npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@techzenith-technologies/event-orchestrator

v1.0.3

Published

Un package offrant un moyen simple et structuré de créer, d'émettre et d'écouter des événements, facilitant la communication entre les différents composants du système.

Downloads

485

Readme

Orchestrateur d'Événements (Kafka & RabbitMQ)

@techzenith-technologies/event-orchestrator est une solution d'orchestration d'événements de classe mondiale, entièrement pilotée par la configuration. Ce package abstrait les complexités protocolaires de Kafka et RabbitMQ, permettant aux équipes de se concentrer exclusivement sur la logique métier.

Fonctionnalités

  • Support hybride multi-broker : Intégrez Kafka et RabbitMQ de manière transparente au sein de la même application.
  • Piloté par la configuration : Définissez toute votre infrastructure d'événements dans une configuration unique et déclarative.
  • Résilience native : Gestion intégrée des tentatives (retries) avec backoff exponentiel et reconnexion automatique.
  • Pipeline de Middleware : Support extensible pour le logging, la validation ou la transformation des messages.
  • Abstraction de protocole : API unifiée pour émettre et consommer des événements, quel que soit le broker sous-jacent.

Installation

npm install @techzenith-technologies/event-orchestrator

Configuration

La configuration du système est définie lors de la phase d'initialisation. Vous pouvez configurer un seul broker ou une architecture hybride en utilisant un tableau de définitions.

Exemple Hybride (Kafka & RabbitMQ)

const config = {
  brokers: [
    {
      name: 'kafka-primary',
      type: 'kafka',
      connection: { 
        brokers: ['localhost:9092'], 
        clientId: 'app-service',
        groupId: 'order-group' 
      },
      retryOptions: {
        retries: 5,
        minTimeout: 1000,
        factor: 2
      },
      mappings: [
        { source: 'orders-topic', eventType: 'OrderCreated', actionName: 'processOrder' }
      ]
    },
    {
      name: 'rabbitmq-local',
      type: 'rabbitmq',
      connection: { 
        url: 'amqp://localhost' 
      },
      mappings: [
        { source: 'notifications-queue', eventType: 'user.signup', actionName: 'sendEmail' }
      ]
    }
  ]
};

Usage

1. Define Actions & Directory Structure

Actions are plain JavaScript functions that handle event data. For small projects, you can define them in a single object. For production-grade applications, we recommend organizing them in an actions/ folder.

Recommended Structure

project/
└── src/
    └── actions/              # Folder containing your business logic
        ├── orderActions.js   # Exports { processOrder }
        └── userActions.js    # Exports { sendEmail }

Example Action File (actions/orderActions.js)

exports.processOrder = async (data) => {
  console.log('Processing order:', data.orderId);
  // Business logic here...
};

2. Initialize and Inject

The orchestrator can automatically load all actions from a directory. Use the path library to provide an absolute path to your actions folder during initialization.

const path = require('path');
const eventManager = require('@techzenith-technologies/event-orchestrator');

// Add optional middleware
eventManager.use(async (data, event) => {
  console.log(`Received ${event}`);
});

async function start() {
  const actionsPath = path.join(__dirname, 'actions');
  await eventManager.initialize(config, actionsPath);
}

3. Emit Events

await eventManager.emit('order.created', { orderId: 123, status: 'pending' });

Error Handling & Retries

  • Connection: RabbitMQ automatically attempts to reconnect every 5 seconds if the connection drops. KafkaJS uses its internal retry strategy for client operations.
  • Actions: If an action (or middleware) fails, the package will retry the execution using exponential backoff based on the retryOptions provided in the config.