CQRS-DDD
Reusable behavior pipelines for TypeScript functions and CQRS handlers, with optional DDD building blocks and a NestJS adapter. Add validation, authorization, caching and idempotency around application operations. Start with a function, add command and query buses when they help, or keep your existing NestJS application.
The repository is ddd-cqrs; the packages install from the npm scope @cqrs-ddd/*. They need Node.js 22.12 or later and no framework or dependency-injection container, and they are dual-licensed, AGPLv3 or commercial: see the license.
Choose a path
Section titled “Choose a path”FunctionsOne file, one command to install, one to run: a validated and logged function on plain Node.js.
CQRS without a frameworkA command, an event and their decorated handlers on the buses of createCqrs(), in one file.
NestJSKeep @nestjs/cqrs and its buses; a complete root module adds behavior pipelines around your handlers.
Domain building blocksAggregates, domain events and repository contracts, usable without any pipeline package.
What is here
Section titled “What is here”OverviewWhat the packages are, how they fit together and how they relate to what you already use.
ConceptsHow an operation is named and kinded, in which order behaviors run, and what the context holds.
CQRS without NestJSDecorated handlers, a pipeline per handler and the buses of createCqrs(), with no container.
GuidesPlain Node.js, class methods, CQRS, coming from NestJS, DDD, HTTP with Express and Fastify, multi-tenancy, background jobs, testing, custom behaviors and HTTP errors.
NestJS IntegrationGlue NestJS and @nestjs/cqrs handlers with behavior pipelines and ErrorFilter via @cqrs-ddd/nestjs.
PackagesOne page per package: what it does, how to install it and how to configure it.