Skip to main content
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
15 hours ago (0.2.0)

Pico Event Store

Minimalistic event store implementation

integrate

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

const streamName = "shoppingcart-1234";

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

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

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

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";