{"id":16906337,"url":"https://github.com/chrisru/es6-eventhub","last_synced_at":"2026-04-29T13:35:52.695Z","repository":{"id":57227132,"uuid":"95316475","full_name":"ChrisRu/es6-eventhub","owner":"ChrisRu","description":"🔥 Simple event emitter and listener built in ES6","archived":false,"fork":false,"pushed_at":"2018-10-17T18:30:03.000Z","size":44,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T01:33:51.731Z","etag":null,"topics":["es6","es6-eventhub","es6-events","eventhub","eventlistener","events","jest"],"latest_commit_sha":null,"homepage":"https://npm.im/es6-eventhub","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/ChrisRu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-24T18:47:37.000Z","updated_at":"2020-05-07T09:59:54.000Z","dependencies_parsed_at":"2022-09-06T13:22:13.911Z","dependency_job_id":null,"html_url":"https://github.com/ChrisRu/es6-eventhub","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisRu%2Fes6-eventhub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisRu%2Fes6-eventhub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisRu%2Fes6-eventhub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisRu%2Fes6-eventhub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChrisRu","download_url":"https://codeload.github.com/ChrisRu/es6-eventhub/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244649965,"owners_count":20487529,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["es6","es6-eventhub","es6-events","eventhub","eventlistener","events","jest"],"created_at":"2024-10-13T18:42:17.480Z","updated_at":"2026-04-29T13:35:52.658Z","avatar_url":"https://github.com/ChrisRu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ES6 Events\n\n[![Licence](https://img.shields.io/github/license/ChrisRu/es6-eventhub.svg)](https://github.com/ChrisRu/es6-eventhub/blob/master/LICENSE.md)\n[![Tests](https://circleci.com/gh/circleci/mongofinil.svg?\u0026style=shield\u0026circle-token=b14acf911433d315298235b0c2fbf7b2670a92a8)](https://circleci.com/gh/ChrisRu/es6-eventhub)\n\nA simple event emitter and listener built in ES6.\n\n## Methods\n\n### `eventhub.on`\n\n#### Init listener on string.\n\n```js\neventhub.on('string', handler);\n```\n\n### `eventhub.onAll`\n\n#### Init listener on all strings.\n\n```js\neventhub.on('string', handler);\n```\n\n### `eventhub.once`\n\n#### Fire event only once, then remove the event.\n\n```js\neventhub.once('string', handler);\n```\n\n### `eventhub.emit`\n\n#### Fire event on string with arguments.\n\n```js\neventhub.emit('string', ...args);\n```\n\n#### Fire event on string without arguments.\n\n```js\neventhub.emit('string');\n```\n\n### `eventhub.remove`\n\n#### Remove event from the eventhub list with the same string and handler.\n\n```js\neventhub.remove('event', handler);\n```\n\n#### Remove event from the eventhub list with the same string.\n\n```js\neventhub.remove('string');\n```\n\n## Usage\n\n```js\nimport Eventhub from 'eventhub';\nconst eventhub = new Eventhub();\n\neventhub.on('text-change', text =\u003e {\n  console.log('Text changed to', text);\n});\n\neventhub.emit('text-change', 'New Text');\n```\n\nor\n\n```js\nimport Eventhub from 'eventhub';\nconst eventhub = new Eventhub()\n  .on('text-change', text =\u003e {\n    console.log('Text changed to', text);\n  })\n  .emit('text-change', 'New Text');\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisru%2Fes6-eventhub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisru%2Fes6-eventhub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisru%2Fes6-eventhub/lists"}