{"id":42830279,"url":"https://github.com/wide/emitter","last_synced_at":"2026-01-30T11:26:45.498Z","repository":{"id":53741414,"uuid":"267885093","full_name":"wide/emitter","owner":"wide","description":"Offer a simple yet useful way of communication between components.","archived":false,"fork":false,"pushed_at":"2021-06-16T21:12:19.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-10-06T00:58:20.408Z","etag":null,"topics":["modulus"],"latest_commit_sha":null,"homepage":null,"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/wide.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}},"created_at":"2020-05-29T14:58:28.000Z","updated_at":"2021-06-16T21:11:52.000Z","dependencies_parsed_at":"2022-08-25T00:22:08.409Z","dependency_job_id":null,"html_url":"https://github.com/wide/emitter","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/wide/emitter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Femitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Femitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Femitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Femitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wide","download_url":"https://codeload.github.com/wide/emitter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Femitter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28911821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T08:15:08.179Z","status":"ssl_error","status_checked_at":"2026-01-30T08:14:31.507Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["modulus"],"created_at":"2026-01-30T11:26:44.777Z","updated_at":"2026-01-30T11:26:45.494Z","avatar_url":"https://github.com/wide.png","language":"JavaScript","readme":"# Event Emitter\n\nOffer a simple yet useful way of communication between components.\n\n\n## Install\n\n```\nnpm install @wide/emitter --save\n```\n\n\n## Listen events\n\n```js\nimport emitter from '@wide/emitter'\n\nemitter.on('test', (a, b, c) =\u003e {})\n```\n\nor outside your script (without access to `emitter`)\n```js\ndocument.onEvent('test', (1, 2, 3) =\u003e {})\n```\n\n\n##3 Listen event once only\n\n```js\nimport emitter from '@wide/emitter'\n\nemitter.on('test', (a, b, c) =\u003e {}, { once: true })\n// or\ndocument.onEvent('test', (1, 2, 3) =\u003e {}, { once: true })\n```\n\n\n## Emit events\n\n```js\nimport emitter from '@wide/emitter'\n\nemitter.emit('test', 1, 2, 3)\n// or\ndocument.emitEvent('test', 1, 2, 3)\n```\n\n\n## Unlisten event\n\n```js\nimport emitter from '@wide/emitter'\n\nconst ref = emitter.on('test', (a, b, c) =\u003e {})\n\nemitter.off(ref)\n```\n\n\n## Behind the scene\n\nThis emitter does not re-create an event dispatcher, but instead make use of `document` own event system, for exemple:\n```js\nemitter.emit('test', 1, 2, 3)\n// or\ndocument.emitEvent('test', 1, 2, 3)\n```\nbecomes:\n```js\ndocument.dispatchEvent(new CustomEvent('@test', { detail: [1, 2, 3] }))\n```\n\n\n## Authors\n\n- **Aymeric Assier** - [github.com/myeti](https://github.com/myeti)\n- **Julien Martins Da Costa** - [github.com/jdacosta](https://github.com/jdacosta)\n\n\n## License\n\nThis project is licensed under the MIT License - see the [licence](licence) file for details","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwide%2Femitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwide%2Femitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwide%2Femitter/lists"}