Type-safe event bus system for Writerr plugin ecosystem and Obsidian plugin development.
npm install writerr-event-bus
import { EventBus } from 'writerr-event-bus';
// Create an event bus instance
const eventBus = new EventBus();
// Listen for events
eventBus.on('document-changed', (data) => {
console.log('Document changed:', data);
});
// Emit events
eventBus.emit('document-changed', {
file: 'example.md',
changes: ['line 1 modified']
});
- Type-safe: Full TypeScript support with strong typing
- Lightweight: Minimal dependencies, optimized for Obsidian plugins
- Middleware support: Extensible with custom middleware
- Schema validation: Built-in validation for event payloads
- Inter-plugin communication: Designed for plugin-to-plugin messaging
See the full documentation for detailed API reference.
MIT © Writerr Team