Develop, test, debug, and deploy KurrentDB projections.
KurrentDB projections are server-side JavaScript that derive new streams and state from existing events. Gaffer uses the same JS engine as KurrentDB itself, so what you debug locally behaves like what runs in production.
CLI:
npm i -g @kurrent/gafferVS Code extension - install KurrentDB Projections from the marketplace for run/debug from gaffer.toml, breakpoint debugging, and an auto-registered MCP server.
Test library:
npm i -D @kurrent/projections-testingRun a projection from the CLI:
gaffer dev order-count --fixture happyOr test it from your existing test suite:
import { createProjection } from "@kurrent/projections-testing";
const projection = createProjection<{ count: number }>(`
fromAll().when({
$init: () => ({ count: 0 }),
OrderPlaced: (s) => ({ count: s.count + 1 }),
});
`);
for (const { state } of projection.run(events)) {
// assert on state at each step
}See the demo project for a complete example with fixtures, errors, partitioned state, and bi-state projections.
| Component | Package | License |
|---|---|---|
| CLI | @kurrent/gaffer |
Kurrent License v1 |
| VS Code extension | kurrent-io.gaffer |
Kurrent License v1 |
| Test library | @kurrent/projections-testing |
Apache 2.0 |
| JS bindings | @kurrent/gaffer-runtime |
Kurrent License v1 |
| Go bindings | github.com/kurrent-io/gaffer/bindings/go |
Kurrent License v1 |
Per-component LICENSE files live in each directory. See LICENSE_CONTRIBUTIONS.md for the license map and NOTICE.md for third-party attribution.
See CONTRIBUTING.md for development setup and conventions. Bugs go to Issues; feature requests and questions to Discussions.
