Skip to main content
This release is 1 version behind 0.2.0 — the latest version of @tjercus/pico-event-store. Jump to latest
It is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
70%
Published
a month ago (0.1.0)

Pico Event Store

Minimalistic event store implementation

integrate

const streamName = 'shoppingcart-1234';

const db = PicoEventStoreImpl("/tmp/databases/my-app");

const streamCreateResult = db.createStream<>(streamName);


streamCreateResult.caseOf({
  Right: console.log,
  Left: console.error
});

type SomeEvent<T> = {
  type: string;
  data: T;
}

const cartCreatedEvent: SomeEvent<string> = {
  type: "CartCreated",
  data: "1234"
};

const appendResult = db.appendToStream<SomeEvent<string>>(streamName, cartCreatedEvent);

appendResult.caseOf({
  Right: console.log,
  Left: console.error
});

test

npm run test

Add Package

deno add jsr:@tjercus/pico-event-store

Import symbol

import * as pico_event_store from "@tjercus/pico-event-store";

---- OR ----

Import directly with a jsr specifier

import * as pico_event_store from "jsr:@tjercus/pico-event-store";

Add Package

npx jsr add @tjercus/pico-event-store

Import symbol

import * as pico_event_store from "@tjercus/pico-event-store";

Add Package

yarn dlx jsr add @tjercus/pico-event-store

Import symbol

import * as pico_event_store from "@tjercus/pico-event-store";

Add Package

pnpm dlx jsr add @tjercus/pico-event-store

Import symbol

import * as pico_event_store from "@tjercus/pico-event-store";

Add Package

bunx jsr add @tjercus/pico-event-store

Import symbol

import * as pico_event_store from "@tjercus/pico-event-store";