@artworkdev/cqrs is a TypeScript library that helps developers build applications using the CQRS pattern—a way to cleanly separate operations that change data from operations that read data. It provides buses that route commands, queries, and events; building blocks for domain objects; and an outbox system that ensures events are stored reliably before being processed. The library works with any database and includes a SQLite adapter for production use.
How It Works
You've been building an application and heard about CQRS—a pattern that separates the parts that change data from the parts that read data.
You bring in the library and it gives you everything you need: buses to route work, helpers to build your pieces, and error messages that actually make sense.
For each thing your app does—like registering a new user or placing an order—you write a small command that describes the intent.
For each piece of information your app needs—like a user profile or a list of orders—you write a query that knows how to fetch it.
When something important happens, your app can fire an event, and any part of your system that cares can listen and react—like sending a welcome email when someone signs up.
Use the temporary memory version while building and testing—no setup required.
Link to a SQLite database that will reliably hold your events so nothing gets lost.
Every action has a home, every question has an answer, and when things happen, everyone who needs to know will find out—reliably.
Star Growth
Repurpose is a Pro feature
Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.
Unlock RepurposeSimilar repos coming soon.