
Security News
Socket Security Analysis Is Now One Click Away on npm
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.
@vendit-dev/event-store
Advanced tools
Modern Node.js event store supporting multiple databases for CQRS and Event Sourcing patterns
A modern, TypeScript-first event store for Node.js supporting multiple databases. Perfect for implementing CQRS (Command Query Responsibility Segregation) and Event Sourcing patterns.
npm install @vendit-dev/event-store
# Install database-specific drivers as needed
npm install mongodb # For MongoDB
npm install redis # For Redis
npm install @aws-sdk/client-dynamodb @aws-sdk/lib-dynamodb # For DynamoDB
npm install @elastic/elasticsearch # For Elasticsearch
npm install @azure/data-tables # For Azure Tables
import { createEventStore } from '@vendit-dev/event-store';
// Create event store with MongoDB
const eventStore = createEventStore({
type: 'mongodb',
options: {
url: 'mongodb://localhost:27017',
database: 'eventstore'
}
});
// Initialize connection
await eventStore.init();
// Get event stream for an aggregate
const stream = await eventStore.getEventStream({ aggregateId: 'user-123' });
// Add events to the stream
stream.addEvent({
aggregateId: 'user-123',
payload: { type: 'UserCreated', name: 'John Doe', email: 'john@example.com' }
});
// Commit events
await stream.commit();
import { EventStore } from '@vendit-dev/event-store';
const config = {
type: 'mongodb',
options: {
url: 'mongodb://localhost:27017',
database: 'eventstore',
collection: 'events'
},
maxSnapshotsCount: 10,
emitStoreEvents: true
};
const eventStore = new EventStore(config);
| Database | Type | Status | Notes |
|---|---|---|---|
| In-Memory | inmemory | ✅ Ready | Development/testing |
| MongoDB | mongodb | ✅ Ready | Recommended for production |
| Redis | redis | ✅ Ready | High-performance option |
| DynamoDB | dynamodb | ✅ Ready | AWS-native solution |
| Elasticsearch | elasticsearch | ✅ Ready | Search-optimized |
| Azure Table | azuretable | ✅ Ready | Azure-native solution |
// Create event stream
const stream = await eventStore.getEventStream({
aggregateId: 'order-456'
});
// Add multiple events
stream.addEvent({
aggregateId: 'order-456',
payload: { type: 'OrderCreated', customerId: 'cust-123', amount: 100 }
});
stream.addEvent({
aggregateId: 'order-456',
payload: { type: 'OrderItemAdded', productId: 'prod-789', quantity: 2 }
});
// Commit all events atomically
await stream.commit();
// Query events
const events = await eventStore.getEvents({
aggregateId: 'order-456'
});
console.log(`Found ${events.length} events`);
// Create snapshot
await eventStore.createSnapshot({
aggregateId: 'user-123',
revision: 10,
data: { name: 'John Doe', email: 'john@example.com', isActive: true }
});
// Load from snapshot
const { snapshot, eventStream } = await eventStore.getFromSnapshot({
aggregateId: 'user-123'
});
if (snapshot) {
console.log(`Loaded snapshot at revision ${snapshot.revision}`);
console.log(`${eventStream.events.length} events since snapshot`);
}
# Run tests
npm test
# Run tests in watch mode
npm run test:watch
# Run with coverage
npm run test:coverage
# Clone repository
git clone https://github.com/ScripterSugar/-vendit-dev-event-store.git
cd -vendit-dev-event-store
# Install dependencies
npm install
# Build project
npm run build
# Run in development mode
npm run dev
# Lint code
npm run lint
# Format code
npm run format
This is a complete rewrite with breaking changes. See MIGRATION.md for detailed migration guide.
MIT © ScripterSugar
Contributions are welcome! Please read our Contributing Guide for details.
⚠️ Alpha Release: This is an alpha version. APIs may change before the stable release.
FAQs
Node-eventstore is a node.js module for multiple databases. It can be very useful as eventstore if you work with (d)ddd, cqrs, eventsourcing, commands and events, etc.
The npm package @vendit-dev/event-store receives a total of 11 weekly downloads. As such, @vendit-dev/event-store popularity was classified as not popular.
We found that @vendit-dev/event-store demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.

Security News
A compromised npm publish token was used to push a malicious postinstall script in cline@2.3.0, affecting the popular AI coding agent CLI with 90k weekly downloads.

Product
Socket is now scanning AI agent skills across multiple languages and ecosystems, detecting malicious behavior before developers install, starting with skills.sh's 60,000+ skills.