{"id":15690120,"url":"https://github.com/jamiemason/glob-bus","last_synced_at":"2025-07-02T13:07:33.828Z","repository":{"id":66237132,"uuid":"1495368","full_name":"JamieMason/glob-bus","owner":"JamieMason","description":"249 byte event emitter / pubsub with namespaced wildcards.","archived":false,"fork":false,"pushed_at":"2022-01-02T20:29:34.000Z","size":14695,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-07T23:27:21.126Z","etag":null,"topics":["event","event-bus","event-handlers","event-listener","eventbus","eventemitter","events","listener","mitt","pub-sub","publish","pubsub","subscribe","typescript"],"latest_commit_sha":null,"homepage":"https://github.com/JamieMason/glob-bus","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/JamieMason.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":"2011-03-18T09:15:23.000Z","updated_at":"2024-09-26T06:54:27.000Z","dependencies_parsed_at":"2023-02-20T16:31:15.497Z","dependency_job_id":null,"html_url":"https://github.com/JamieMason/glob-bus","commit_stats":{"total_commits":52,"total_committers":4,"mean_commits":13.0,"dds":0.4807692307692307,"last_synced_commit":"fb1d7a19786352f725f3add4746bbe44349451a7"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/JamieMason/glob-bus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2Fglob-bus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2Fglob-bus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2Fglob-bus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2Fglob-bus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JamieMason","download_url":"https://codeload.github.com/JamieMason/glob-bus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2Fglob-bus/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263145894,"owners_count":23420681,"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":["event","event-bus","event-handlers","event-listener","eventbus","eventemitter","events","listener","mitt","pub-sub","publish","pubsub","subscribe","typescript"],"created_at":"2024-10-03T18:07:38.152Z","updated_at":"2025-07-02T13:07:33.806Z","avatar_url":"https://github.com/JamieMason.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# glob-bus\n\n249 byte pub/sub event bus with namespaced wildcard support.\n\n[![NPM version](http://img.shields.io/npm/v/glob-bus.svg?style=flat-square)](https://www.npmjs.com/package/glob-bus)\n[![NPM downloads](http://img.shields.io/npm/dm/glob-bus.svg?style=flat-square)](https://www.npmjs.com/package/glob-bus)\n[![Follow JamieMason on GitHub](https://img.shields.io/github/followers/JamieMason.svg?style=social\u0026label=Follow)](https://github.com/JamieMason)\n[![Follow fold_left on Twitter](https://img.shields.io/twitter/follow/fold_left.svg?style=social\u0026label=Follow)](https://twitter.com/fold_left)\n\n## Installation\n\n```\nnpm install --save glob-bus\n```\n\n## Example\n\nIn this example, all three listeners will be invoked.\n\n```ts\nimport { globBus } from 'glob-bus';\n\ntype Event =\n  | { type: 'basket.product.add'; id: number }\n  | { type: 'basket.product.remove'; id: number };\n\nconst { on, send } = globBus\u003cEvent\u003e();\n\non('*', (event: Event) =\u003e console.log(1, event));\non('basket.*', (event: Event) =\u003e console.log(2, event));\non('basket.product.*', (event: Event) =\u003e console.log(3, event));\n\nsend({ type: 'basket.product.add', id: 123 });\n```\n\nThe `on` function returns a function to unregister the given listener:\n\n```ts\nimport { globBus } from 'glob-bus';\n\nconst { on, send } = globBus();\nconst off = on('basket.product.*', fn);\n\noff();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamiemason%2Fglob-bus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamiemason%2Fglob-bus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamiemason%2Fglob-bus/lists"}