Skip to content

kurrent-io/gaffer

Repository files navigation

Gaffer

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.

Install

CLI:

npm i -g @kurrent/gaffer

VS 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-testing

Quick start

Run a projection from the CLI:

gaffer dev order-count --fixture happy

gaffer dev replaying the order-count projection against the happy fixture

Or 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.

Packages

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.

Communities

Contributing

See CONTRIBUTING.md for development setup and conventions. Bugs go to Issues; feature requests and questions to Discussions.

About

Dev toolkit for KurrentDB projections - local development, testing, debugging, and deployment.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors