{"id":32248567,"url":"https://github.com/vlavrynovych/simple-event-handler","last_synced_at":"2026-02-25T09:37:54.841Z","repository":{"id":57360105,"uuid":"83458095","full_name":"vlavrynovych/simple-event-handler","owner":"vlavrynovych","description":"A lightweight, framework-agnostic event handler library for both front-end and back-end JavaScript applications. Implement the pub/sub (publisher-subscriber) pattern to decouple your code and enable event-driven architecture. Works seamlessly in browsers, Node.js, and modern JavaScript frameworks like React, Vue, and Angular.","archived":false,"fork":false,"pushed_at":"2026-01-22T21:55:27.000Z","size":425,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2026-02-19T17:18:51.438Z","etag":null,"topics":["event","event-handler","handler","pubsub","pubsub-subscriber","subscribe","subscription"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vlavrynovych.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-28T17:02:19.000Z","updated_at":"2026-01-22T21:58:02.000Z","dependencies_parsed_at":"2022-08-30T20:01:05.763Z","dependency_job_id":null,"html_url":"https://github.com/vlavrynovych/simple-event-handler","commit_stats":null,"previous_names":["vlavrynovych/event-handler"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/vlavrynovych/simple-event-handler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlavrynovych%2Fsimple-event-handler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlavrynovych%2Fsimple-event-handler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlavrynovych%2Fsimple-event-handler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlavrynovych%2Fsimple-event-handler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vlavrynovych","download_url":"https://codeload.github.com/vlavrynovych/simple-event-handler/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlavrynovych%2Fsimple-event-handler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29816200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T05:36:42.804Z","status":"ssl_error","status_checked_at":"2026-02-25T05:36:31.934Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["event","event-handler","handler","pubsub","pubsub-subscriber","subscribe","subscription"],"created_at":"2025-10-22T17:44:49.326Z","updated_at":"2026-02-25T09:37:54.836Z","avatar_url":"https://github.com/vlavrynovych.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simple-event-handler\n\nA lightweight, framework-agnostic event handler library for both **front-end** and **back-end** JavaScript applications. Implement the pub/sub (publisher-subscriber) pattern to decouple your code and enable event-driven architecture. Works seamlessly in browsers, Node.js, and modern JavaScript frameworks like React, Vue, and Angular.\n\nPerfect for managing application-wide events, component communication, real-time updates, and building loosely coupled, maintainable codebases.\n\n[![Test](https://github.com/vlavrynovych/simple-event-handler/actions/workflows/test.yml/badge.svg)](https://github.com/vlavrynovych/simple-event-handler/actions/workflows/test.yml)\n[![Coverage Status](https://coveralls.io/repos/github/vlavrynovych/simple-event-handler/badge.svg?branch=develop)](https://coveralls.io/github/vlavrynovych/simple-event-handler?branch=develop)\n[![NPM Version](https://img.shields.io/npm/v/simple-event-handler.svg)](https://npmjs.org/package/simple-event-handler)\n[![NPM Downloads](https://img.shields.io/npm/dm/simple-event-handler.svg)](https://npmjs.org/package/simple-event-handler)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![Bundle Size](https://img.shields.io/bundlephobia/minzip/simple-event-handler)](https://bundlephobia.com/package/simple-event-handler)\n\n## Features\n\n- 🚀 **Lightweight** - Less than 2KB minified\n- 🔧 **Zero Dependencies** - No external requirements\n- 💪 **TypeScript** - Full type definitions included\n- 🌐 **Universal** - Works in browser and Node.js\n- ⚡ **Fast** - Optimized for performance\n- 🔗 **Method Chaining** - Fluent API support\n- 📦 **Multiple Formats** - UMD, CommonJS, ES Module\n- ✅ **100% Test Coverage** - Thoroughly tested\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Quick Start](#quick-start)\n- [Examples](EXAMPLES.md) 📚\n- [API Documentation](API.md) 📖\n- [Changelog](CHANGELOG.md) 📝\n- [License](#license)\n\n## Installation\n\n### npm\n\n```bash\nnpm install simple-event-handler\n```\n\n### yarn\n\n```bash\nyarn add simple-event-handler\n```\n\n### pnpm\n\n```bash\npnpm add simple-event-handler\n```\n\n### CDN\n\n```html\n\u003cscript src=\"https://unpkg.com/simple-event-handler/dist/simple-event-handler.min.js\"\u003e\u003c/script\u003e\n```\n\n## Quick Start\n\n```javascript\nimport eventHandler from 'simple-event-handler';\n\n// Subscribe to an event\neventHandler.subscribe('user:login', (user) =\u003e {\n  console.log('User logged in:', user.name);\n});\n\n// Fire the event\neventHandler.fire('user:login', { name: 'John Doe' });\n```\n\n## Examples\n\nFor comprehensive usage examples including React, Vue, TypeScript, and more, see [EXAMPLES.md](EXAMPLES.md).\n\n**Quick examples:**\n\n```javascript\n// Node.js / CommonJS\nconst eventHandler = require('simple-event-handler');\neventHandler.subscribe('event', (data) =\u003e console.log(data));\neventHandler.fire('event', { message: 'Hello!' });\n\n// ES Modules / TypeScript\nimport eventHandler from 'simple-event-handler';\neventHandler.on('notification', (msg) =\u003e console.log(msg));\neventHandler.emit('notification', 'Hello from ESM!');\n\n// Method chaining\neventHandler\n  .subscribe('update', (data) =\u003e console.log(data))\n  .fire('update', { value: 42 })\n  .unsubscribeAll('update');\n```\n\n## API Documentation\n\nFor complete API reference, see [API.md](API.md).\n\n**Quick Reference:**\n- [`subscribe(events, handler, $scope?)`](API.md#subscribeevents-handler-scope) / [`on()`](API.md#onevents-handler-scope) - Register event handler(s)\n- [`once(events, handler, $scope?)`](API.md#onceevents-handler-scope) - Register one-time handler\n- [`fire(name, args?)`](API.md#firename-args) / [`emit()`](API.md#emitname-args) - Trigger event\n- [`unsubscribe(name, handler)`](API.md#unsubscribename-handler) / [`off()`](API.md#offname-handler) - Remove specific handler\n- [`unsubscribeAll(name)`](API.md#unsubscribeallname) / [`offAll()`](API.md#offallname) - Remove all handlers\n\n## License\n\nMIT - See [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvlavrynovych%2Fsimple-event-handler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvlavrynovych%2Fsimple-event-handler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvlavrynovych%2Fsimple-event-handler/lists"}