{"id":15632009,"url":"https://github.com/ianwalter/subpub","last_synced_at":"2026-01-20T02:36:25.004Z","repository":{"id":42218087,"uuid":"153866145","full_name":"ianwalter/subpub","owner":"ianwalter","description":"A super-simple JavaScript Subscribe/Publish (pubsub) implementation","archived":false,"fork":false,"pushed_at":"2023-10-17T17:03:06.000Z","size":688,"stargazers_count":2,"open_issues_count":18,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-13T05:34:22.015Z","etag":null,"topics":["events","pattern-matching","pubsub"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ianwalter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"ianwalter"}},"created_at":"2018-10-20T03:30:24.000Z","updated_at":"2023-03-04T05:53:34.000Z","dependencies_parsed_at":"2023-02-01T08:01:03.025Z","dependency_job_id":"81c951e5-50e1-4fc5-a81d-95ec5b3bf0c4","html_url":"https://github.com/ianwalter/subpub","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianwalter%2Fsubpub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianwalter%2Fsubpub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianwalter%2Fsubpub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianwalter%2Fsubpub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ianwalter","download_url":"https://codeload.github.com/ianwalter/subpub/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247569138,"owners_count":20959758,"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":["events","pattern-matching","pubsub"],"created_at":"2024-10-03T10:42:22.298Z","updated_at":"2026-01-20T02:36:24.978Z","avatar_url":"https://github.com/ianwalter.png","language":"JavaScript","funding_links":["https://github.com/sponsors/ianwalter"],"categories":[],"sub_categories":[],"readme":"# @ianwalter/subpub\n\u003e A super-simple JavaScript Subscribe/Publish (pubsub) implementation\n\n[![npm page][npmImage]][npmUrl]\n\n## Installation\n\n```console\nyarn add @ianwalter/subpub\n```\n\n## Usage\n\n```js\nimport { Subpub } from '@ianwalter/subpub'\n\n// Create a Subpub instance.\nconst sp = new Subpub()\n\n// Create a subscription to a topic.\nconst usubscribe = sp.sub('alerts', msg =\u003e console.log(msg))\n\n// Publish a message on the topic.\nsp.pub('alerts', 'We ran out of coffee!')\n\n// Unsubscribe the subscriber from the topic.\nusubscribe()\n\n// Create a subscriber with an object key that can be pattern-matched.\nsp.sub({ key: '1d', name: 'BIBA' }, async msg =\u003e msg.toUpperCase())\n\n// Send a message to the subscriber using only the key property to match and\n// wait for the returned promise to resolve with the transformed value.\nawait sp.pub({ key: '1d' }, 'Te biba nachdi') // =\u003e TE BIBA NACHDI\n```\n\n## License\n\nApache 2.0 with Commons Clause - See [LICENSE][licenseUrl]\n\n\u0026nbsp;\n\nCreated by [Ian Walter](https://ianwalter.dev)\n\n[npmImage]: https://img.shields.io/npm/v/@ianwalter/subpub.svg\n[npmUrl]: https://www.npmjs.com/package/@ianwalter/subpub\n[licenseUrl]: https://github.com/ianwalter/subpub/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianwalter%2Fsubpub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fianwalter%2Fsubpub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianwalter%2Fsubpub/lists"}