3.1.4 • Published 1 year ago
@bahatron/mercurios v3.1.4
Mercurios
Event Sourcing != Async Messaging
Notes
- Event ordering is not guaranteed. However, it's possible to use
expectedSeq
when publishing to control the order of events in a stream
Getting Started
npm install --save @bahatron/mercurios
import mercurios from "@bahatron/mercurios";
let client = mercurios.connect({ url: "postgres://postgres:5432" });
// appends an event to topic
let event = await client.append("myTopic", {
data: { foo: "bar" },
expectedSeq: 5,
});
// fetch an event by sequence
let event = await client.read("myTopic", 2);
// filter topic events
let events = await client.filter("myTopic", {
from: 1,
to: 5,
before: "2021-09-01",
key: "a_key",
});
// lists topics
let topics = await client.topics({
like: "user.*",
withEvents: {
after: "2021",
},
});
Dev Environment
- node:12+
- docker
- docker-compose
npm install && npm run dev
Migration from v2 to v3
- Only Postgres Driver is available currently in v3
- No need for HTTP server anymore, just npm install and code away!
- NATS is no longer a dependency
- Subscribing to topics is no longer possible
- Emit event method removed
- "publish" method renamed to "append"
- Event data structure changes:
- published_at -> timestamp
3.1.4
1 year ago
3.1.3
2 years ago
3.1.2
3 years ago
3.1.1
4 years ago
3.1.0
4 years ago
3.0.3
4 years ago
3.0.2
4 years ago
3.0.1
4 years ago
3.0.0
4 years ago
3.0.0-beta.1
4 years ago
3.0.0-beta.0
4 years ago
2.4.2
4 years ago
2.4.1
4 years ago
2.4.0
4 years ago
2.3.4
4 years ago
2.3.3
4 years ago
2.3.2
4 years ago
2.3.1
4 years ago
2.3.0
4 years ago
2.2.5
5 years ago
2.2.4
5 years ago
2.2.3
5 years ago
2.2.2
5 years ago
2.2.1
5 years ago
2.2.0
5 years ago
2.1.1
5 years ago
2.1.0
5 years ago
2.0.1
5 years ago
2.0.0
5 years ago
1.2.2
5 years ago
1.2.1
5 years ago
1.2.0
5 years ago
1.1.1
5 years ago
1.1.0
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago
0.0.4
5 years ago
0.0.3
5 years ago
0.0.2
5 years ago
0.0.1
5 years ago
0.0.0
5 years ago