{"id":13683692,"url":"https://github.com/axtk/evtm","last_synced_at":"2025-04-13T03:19:52.604Z","repository":{"id":41135571,"uuid":"320417323","full_name":"axtk/evtm","owner":"axtk","description":"Event manager with flexible event type matching","archived":false,"fork":false,"pushed_at":"2024-10-30T13:39:20.000Z","size":166,"stargazers_count":10,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-05T09:45:52.649Z","etag":null,"topics":["dispatcher","event-emitter","event-manager","events","mediator"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/evtm","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/axtk.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}},"created_at":"2020-12-10T23:43:55.000Z","updated_at":"2024-10-30T13:39:26.000Z","dependencies_parsed_at":"2024-06-20T17:14:56.396Z","dependency_job_id":"e7d2e158-34aa-4af5-b684-b49d21afc8c1","html_url":"https://github.com/axtk/evtm","commit_stats":{"total_commits":60,"total_committers":1,"mean_commits":60.0,"dds":0.0,"last_synced_commit":"9b32edcb384d95aad5e9061b778c3aa7fb31b441"},"previous_names":["axtk/event-manager"],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axtk%2Fevtm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axtk%2Fevtm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axtk%2Fevtm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axtk%2Fevtm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axtk","download_url":"https://codeload.github.com/axtk/evtm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248553784,"owners_count":21123520,"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":["dispatcher","event-emitter","event-manager","events","mediator"],"created_at":"2024-08-02T13:02:23.626Z","updated_at":"2025-04-13T03:19:52.586Z","avatar_url":"https://github.com/axtk.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"[![npm](https://img.shields.io/npm/v/evtm?labelColor=royalblue\u0026color=royalblue\u0026style=flat-square)](https://www.npmjs.com/package/evtm) ![browser](https://img.shields.io/badge/browser-✓-345?labelColor=345\u0026color=345\u0026style=flat-square) ![node](https://img.shields.io/badge/node-✓-345?labelColor=345\u0026color=345\u0026style=flat-square) ![TypeScript](https://img.shields.io/badge/TypeScript-✓-345?labelColor=345\u0026color=345\u0026style=flat-square)\n\n# evtm\n\n*A lightweight zero-dependency event manager with flexible event type matching*\n\n## Usage\n\nInitialization:\n\n```js\nimport {EventManager} from 'evtm';\n\nlet eventManager = new EventManager();\n```\n\nAdding a handler of a specific event type:\n\n```js\neventManager.addListener('task started', event =\u003e {\n    console.log(event);\n});\n```\n\nOf all events matching the pattern:\n\n```js\neventManager.addListener(/^task\\s/, event =\u003e {\n    console.log(event);\n});\n```\n\nWith captured parameters:\n\n```js\neventManager.addListener(/^(\\S+)\\s(?\u003cstatus\u003e.*)$/, event =\u003e {\n    console.log(event.params[0], event.params.status);\n});\n```\n\nAdding a handler of all events dispatched to the `eventManager` instance:\n\n```js\nlet listener = eventManager.addListener('*', event =\u003e {\n    console.log(event);\n});\n```\n\nDispatching an event of a specific type and properties:\n\n```js\neventManager.dispatch('task started', {x: 42});\n```\n\nRemoving a previously declared listener:\n\n```js\nlistener.remove();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxtk%2Fevtm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxtk%2Fevtm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxtk%2Fevtm/lists"}