The `@domusjs/core` module provides the foundational building blocks for implementing Domain-Driven Design (DDD) and Command Query Responsibility Segregation (CQRS) in TypeScript applications.
npm install @domusjs/coreThe @domusjs/core module provides the foundational building blocks for implementing Domain-Driven Design (DDD) and Command Query Responsibility Segregation (CQRS) in TypeScript applications.
š Full documentation: @domusjs/core Docs
---
- ā
Command and Query Buses (CQRS)
- ā
Domain Events and Entities
- ā
Value Objects and Repositories
- ā
Result wrapper and rich error types
- ā
Interfaces to decouple infrastructure
- ā
Logging
---
``bash`
npm install @domusjs/core
---
`ts
import { Command, Result, CommandHandler } from '@domusjs/core';
class SayHelloCommand implements Command {
constructor(public readonly name: string) {}
}
class SayHelloHandler implements CommandHandler
async execute(command: SayHelloCommand): Promise
console.log(Hello, ${command.name});``
return Result.ok();
}
}
---
For advanced patterns, dependency injection, and more, check out the full documentation: