EventBridge – Your Calendar’s Best Friend
A TypeScript-based event bridge implementation for building robust event-driven architectures.
🚀 Features
- Written in TypeScript with full type safety
- Event routing and handling
- Asynchronous event processing
- Type-safe event publishing and subscription
- Minimal dependencies
- Fully documented API
📋 Prerequisites
- Node.js (version 14.x or higher recommended)
- npm or yarn
- TypeScript 4.x or higher
🛠️ Installation
npm install @not-just-pratul/eventbridge
# or
yarn add @not-just-pratul/eventbridge
🔧 Usage
import { EventBridge } from '@not-just-pratul/eventbridge';
// Initialize the event bridge
const eventBridge = new EventBridge();
// Define your event type
interface UserCreatedEvent {
userId: string;
email: string;
timestamp: Date;
}
// Subscribe to events
eventBridge.subscribe<UserCreatedEvent>('user.created', (event) => {
console.log(`New user created: ${event.email}`);
});
// Publish an event
eventBridge.publish('user.created', {
userId: '123',
email: 'user@example.com',
timestamp: new Date()
});
🧪 Running Tests
npm test
# or
yarn test
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
🔗 Links
📧 Contact
- GitHub: @not-just-pratul
Made with ❤️ by Pratul
Log in or sign up for Devpost to join the conversation.