2.0.1 • Published 1 year ago

nestjs-event-store-cqrs v2.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

A lightweight KafkaJS event-store module for CQRS Nest framework (node.js). It requires @nestjs/cqrs and kafkajs

Installation

$ npm install --save nestjs-event-store-cqrs
$ npm install --save kafkajs

Quick Start

import { Module } from '@nestjs/common';
import { CqrsModule } from '@nestjs/cqrs';
import { EventStoreModule } from 'nestjs-event-store-cqrs';

@Module({
  imports: [
    CqrsModule,
    EventStoreModule.forRoot({
      client: {
        clientId: 'hero',
        brokers: ['localhost:9092'],
      },
      consumer: {
        groupId: 'hero-consumer',
      },
      events: [HeroKilledDragonEvent],
    }),
  ]
})
export class AppModule {}

FULL EXAMPLE