@ocoda/event-sourcing
v4.1.0
Published
NestJS Event Sourcing Library (@core)
Maintainers
Readme
About this library
This is the core module of @ocoda/event-sourcing, a library for NestJS with the building blocks for Domain-Driven Design (DDD), CQRS and Event Sourcing: aggregates, value objects, typed command and query buses, an event store with global positions and readAll(), snapshots, and event publishers and subscribers.
It keeps events and snapshots in memory by default, which is fine for tests and prototypes. For persistence, add a store integration:
Installation
npm install @ocoda/event-sourcingRequires Node.js 22.12 or later, NestJS 12 and, in TypeScript projects, TypeScript 5.4 or later. The package is ESM-only; CommonJS applications load it through require(), which Node.js supports for ES modules since 22.12.
Two entry points need an optional peer dependency:
@ocoda/event-sourcing/class-transformer:ClassTransformerEventSerializer, for events with class-transformer decorators (class-transformer@^0.5.1).@ocoda/event-sourcing/testing: the conformance suites for your own event and snapshot stores (vitest4 or 5).
Documentation 📗
- The documentation starts with the installation.
- Upgrading from 3.x? Follow Migrating from 3.x to 4.0. The 3.x documentation is at ocoda.github.io/event-sourcing/v3.
- Versioning and support and the changelog.
Contact
Acknowledgments
This library is inspired by @nestjs/cqrs
