JSPM

  • Created
  • Published
  • Downloads 535
  • Score
    100M100P100Q91671F
  • License MIT

Event Sourcing with Node.JS

Package Exports

  • evtstore
  • evtstore/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (evtstore) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

EvtStore

Type-safe Event Sourcing and CQRS with Node.JS and TypeScript

Why

I reguarly use event sourcing and wanted to lower the barrier for entry and increase productivity for colleagues.
The design goals were:

  • Provide as much type safety and inference as possible
  • Make creating domains quick and intuitive
  • Be easy to test
  • Allow developers to focus on application/business problems instead of Event Sourcing and CQRS problems

To obtain these goals the design is highly opinionated, but still flexible.

Examples

EvtStore is type-driven to take advantage of type safety and auto completion. We front-load the creation of our Event, Aggregate, and Command types to avoid having to repeatedly import and pass them as generic argument. EvtStore makes use for TypeScript's mapped types and conditional types to achieve this.

See the example folder

Supported Databases

See Providers for more details and examples

  • Postgres using node-postgres
  • SQLite, MySQL, Postgres using Knex
  • In-memory
  • MongoDB
  • Neo4j v3.5
  • Neo4j v4

API

See API