Skip to content

Fediversal/eventstream-lite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌊 eventstream-lite

A lightweight event sourcing library that logs and replays application state changes.

CI License Codespace Ready


🚀 What is eventstream-lite?

eventstream-lite is a zero-dependency event sourcing toolkit. Every state change in your app is recorded as an immutable event. You can replay, audit, and time-travel through your application state — stored in flat JSON files or SQLite.

const { EventStore, EventStream } = require('eventstream-lite');

const store  = new EventStore('./events.json');
const orders = new EventStream('orders', store);

orders.append({ type: 'ORDER_CREATED', data: { id: 1, item: 'Book', qty: 2 } });
orders.append({ type: 'ORDER_PAID',    data: { id: 1, amount: 29.99 } });
orders.append({ type: 'ORDER_SHIPPED', data: { id: 1, tracking: 'XYZ123' } });

// Replay all events
const state = orders.replay();

// Time-travel to a specific point
const pastState = orders.replayUntil('2025-01-15T10:00:00Z');

✨ Features

  • 📝 Immutable append-only event log
  • ⏪ Full event replay from any point in time
  • 🔍 Event filtering by type, aggregate, or time range
  • 💾 JSON file or SQLite storage backends
  • 🔔 Subscribe to event streams with callbacks
  • 📊 Event timeline visualizer in terminal
  • 🧩 Works with any Node.js framework

🏆 Achievement Scripts

bash scripts/setup.sh && bash scripts/unlock-all.sh

🤝 Contributing

See CONTRIBUTING.md

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors