{"id":30383476,"url":"https://github.com/lightning-chart/eventer","last_synced_at":"2026-01-12T05:28:46.337Z","repository":{"id":34999655,"uuid":"195238879","full_name":"Lightning-Chart/Eventer","owner":"Lightning-Chart","description":"Simple and fast event emitter library.","archived":false,"fork":false,"pushed_at":"2024-06-11T17:01:00.000Z","size":1930,"stargazers_count":5,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-15T04:20:55.261Z","etag":null,"topics":["event-emitter","events","javascript","subscription"],"latest_commit_sha":null,"homepage":"https://arction.github.io/Eventer/","language":"TypeScript","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/Lightning-Chart.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2019-07-04T12:37:36.000Z","updated_at":"2024-07-03T07:07:10.000Z","dependencies_parsed_at":"2025-04-01T13:11:36.052Z","dependency_job_id":"dad32452-799c-4eac-8fb3-47e497764121","html_url":"https://github.com/Lightning-Chart/Eventer","commit_stats":null,"previous_names":["lightning-chart/eventer"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Lightning-Chart/Eventer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lightning-Chart%2FEventer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lightning-Chart%2FEventer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lightning-Chart%2FEventer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lightning-Chart%2FEventer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lightning-Chart","download_url":"https://codeload.github.com/Lightning-Chart/Eventer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lightning-Chart%2FEventer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271406042,"owners_count":24753901,"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","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"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":["event-emitter","events","javascript","subscription"],"created_at":"2025-08-21T00:13:37.145Z","updated_at":"2026-01-12T05:28:46.285Z","avatar_url":"https://github.com/Lightning-Chart.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Eventer\n\nSimple and fast event emitter library. Subscription is based on a unique Token, which can be used to unsubscribe from the topic.\n\nThe Eventer is used in LightningChart\u003csup\u003e\u0026#174;\u003c/sup\u003e JS charting library. [https://www.arction.com/](https://www.arction.com/)\n\n## Installation\n\n`npm install --save @arction/eventer`\n\n## Documentation\n\nOnline documentation is available at [arction.github.io/eventer](https://arction.github.io/Eventer/)\n\n## Getting started\n\n```ts\nimport { Eventer } from '@arction/eventer'\n\nconst eventer = new Eventer()\n\n// new topic is created, handler is added as the first subscriber to the topic\nconst token1 = eventer.on('topic1', () =\u003e console.log('I am called from topic1'))\n// 'topic1' already exists, so new listener is simply added to existing collection of handlers\nconst token2 = eventer.on('topic1', () =\u003e console.log('I am also called from topic1'))\n// new collection of handlers is created for the second topic\n// the function is added to it\neventer.on('topic2', () =\u003e console.log('I am called from topic2'))\n\neventer.emit('topic1')\n// calls two functions which listen to the event\n//\n// outputs:\n//    I am called from topic1\n//    I am also called from topic1\n\neventer.emit('topic2')\n// calls single functions which listen to the event\n//\n// outputs:\n//    I am called from topic2\n\n// remove the second listener from the first topic by token \neventer.off(token2)\n\neventer.emit('topic1')\n// calls single functions which listen to the event\n//\n// outputs:\n//    I am called from topic1\n\n// remove all listeners from all topics\neventer.allOff()\n\neventer.emit('topic2')\n// nothing happened, since all subscriptions were terminated\n```\n\n### Subscribe to topic\n\nSubscribing to a topic is easy.\n\n```ts\neventer.on('topic', ()=\u003e{ console.log('Topic handler') })\n```\n\nMultiple subscriptions to a single topic can exist.\n\n```ts\neventer.on('topic', ()=\u003e{ console.log('Topic handler') })\neventer.on('topic2', ()=\u003e{ console.log('Topic 2 handler') })\neventer.on('topic3', ()=\u003e{ console.log('Topic 3 handler') })\n```\n\n### Unsubscribe from topic\n\nYou can unsubscribe from a single topic by using the *Token* returned by eventer when you subscribed to the topic.\n\n```ts\nconst token = eventer.on('topic', ()=\u003e{ console.log('Topic handler') })\n\neventer.off(token)\n```\n\nYou can also unsubscibe all listeners from a topic.\n\n```ts\neventer.topicOff('topic')\n```\n\nIt is also possible to unsubscribe all topics and all listeners.\n\n```ts\neventer.allOff()\n```\n\n### Emiting events\n\nEvents can be emitted for a topic. The emit can contain 0 or more arguments that will be provided to the topic listeners.\n\n```ts\neventer.emit('topic')\n\neventer.on('topic2', ( arg1, arg2 ) =\u003e console.log( arg1, arg2 ))\n\neventer.emit('topic2', 'Hello ', 'World')\n```\n\n## Development instructions\n\nThe project is developed using TypeScript. Build system of the project heavily relies on Node.js. Dependencies are managed with *npm*, therefore, remember to run **npm install** before starting of anything else. \n\nThere are several *npm scripts*, which are used for development process:\n\n| Name     | Command          | Description              |\n| ---------|------------------|--------------------------|\n| build    | npm run build    | run build system\n| test     | npm test         | run tests and watch      |\n| lint     | npm run lint     | run static analyzer and watch\n| docs     | npm run docs     | generate typedoc documentation\n| ci:test  | npm run ci:test  | run tests once\n| ci:lint  | npm run ci:lint  | run static analyzer once\n| ci:watch | npm run ci:watch | run CI circle and watch\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightning-chart%2Feventer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flightning-chart%2Feventer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightning-chart%2Feventer/lists"}