{"id":29407069,"url":"https://github.com/princecodes247/kamui","last_synced_at":"2026-06-29T20:31:44.241Z","repository":{"id":287697136,"uuid":"960139933","full_name":"princecodes247/kamui","owner":"princecodes247","description":"A powerful, type-safe event bus system for Event driven TypeScript applications","archived":false,"fork":false,"pushed_at":"2025-04-13T23:00:14.000Z","size":92,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-30T09:45:28.525Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/princecodes247.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-03T23:31:48.000Z","updated_at":"2025-04-28T21:52:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"76ab75b3-0abf-4f03-a15f-5a527fa725c8","html_url":"https://github.com/princecodes247/kamui","commit_stats":null,"previous_names":["princecodes247/kamui"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/princecodes247/kamui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princecodes247%2Fkamui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princecodes247%2Fkamui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princecodes247%2Fkamui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princecodes247%2Fkamui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/princecodes247","download_url":"https://codeload.github.com/princecodes247/kamui/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/princecodes247%2Fkamui/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34942665,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-29T02:00:05.398Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-11T00:40:31.641Z","updated_at":"2026-06-29T20:31:44.236Z","avatar_url":"https://github.com/princecodes247.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kamui\n\nA powerful, type-safe event bus system for TypeScript applications with advanced event handling capabilities.\n\n## Features\n\n- 🔒 **Type-safe Event Handling**: Fully typed event system that catches type errors at compile time\n- 🚀 **High Performance**: Efficient event dispatching with Set-based listener management\n- 🎯 **Event Metadata**: Automatic tracking of event IDs, timestamps, and names\n- 🔄 **Flexible Architecture**: Support for both EventBus and EventEmitter patterns\n- 🛠 **Extensible Design**: Easy to extend and adapt to different use cases\n\n## Installation\n\n```bash\nnpm install kamui\n# or\nyarn add kamui\n# or\npnpm add kamui\n```\n\n## Usage\n\n### Basic Event Bus Usage\n\n```typescript\nimport { createEventBus, ExtendedEventListener } from 'kamui';\n\n// Define your event types\ntype UserEvents = {\n  'user:created': ExtendedEventListener\u003c{ id: string; name: string }\u003e[];\n  'user:updated': ExtendedEventListener\u003c{ id: string; changes: Record\u003cstring, any\u003e }\u003e[];\n};\n\n// Create event bus instance\nconst eventBus = createEventBus\u003cUserEvents\u003e({\n  'user:created': [],\n  'user:updated': []\n});\n\n// Emit an event\neventBus.emit('user:created', { \n  id: '123', \n  name: 'John Doe' \n});\n```\n\n### Using Event Creator\n\n```typescript\nimport { createEvent } from 'kamui';\n\ntype UserCreatedPayload = { id: string; name: string };\n\nconst userCreatedListeners = createEvent\u003cUserCreatedPayload\u003e(\n  (payload, metadata) =\u003e {\n    console.log(`User created: ${payload.name} at ${metadata?.timestamp}`);\n  }\n);\n```\n\n### Event Emitter Adapter\n\n```typescript\nimport { createEventEmitter } from 'kamui';\n\nconst events = [\n  {\n    name: 'userCreated',\n    listeners: [(metadata, payload) =\u003e console.log(payload)]\n  }\n];\n\nconst emitter = createEventEmitter(events);\nemitter.emit('userCreated', { id: '123', name: 'John Doe' });\n```\n\n## API Reference\n\n### EventBus\n\n- `createEventBus\u003cT\u003e(events)`: Creates a new event bus instance\n- `emit(eventName, payload)`: Emits an event with the given name and payload\n- `getListenerCount(eventName)`: Returns the number of listeners for an event\n\n### EventCreator\n\n- `createEvent\u003cT\u003e(...listeners)`: Creates a new event with the given listeners\n- `addListener(listener)`: Adds a new listener to an event\n- `getListeners()`: Returns all listeners for an event\n\n### Event Types\n\n- `EventMetadata`: Contains event metadata (id, timestamp, name)\n- `EventListener\u003cT\u003e`: Basic event listener type\n- `ExtendedEventListener\u003cT\u003e`: Event listener with metadata support\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprincecodes247%2Fkamui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprincecodes247%2Fkamui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprincecodes247%2Fkamui/lists"}