writerr-event-bus
TypeScript icon, indicating that this package has built-in type declarations

3.0.1 • Public • Published

writerr-event-bus

Type-safe event bus system for Writerr plugin ecosystem and Obsidian plugin development.

Installation

npm install writerr-event-bus

Usage

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']
});

Features

  • 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

API Documentation

See the full documentation for detailed API reference.

License

MIT © Writerr Team

Package Sidebar

Install

npm i writerr-event-bus

Homepage

writerr.dev

Weekly Downloads

130

Version

3.0.1

License

MIT

Unpacked Size

232 kB

Total Files

27

Last publish

Collaborators

  • chriscobb