{"id":26244006,"url":"https://github.com/shystruk/publish-subscribe-js","last_synced_at":"2025-10-10T23:11:56.045Z","repository":{"id":51171692,"uuid":"112757440","full_name":"shystruk/publish-subscribe-js","owner":"shystruk","description":"Publish/Subscribe UMD package ","archived":false,"fork":false,"pushed_at":"2023-02-07T03:56:33.000Z","size":19,"stargazers_count":21,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-03T06:31:40.194Z","etag":null,"topics":["javascript","pattern","publish","publish-subscribe","subscribe"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/publish-subscribe-js","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/shystruk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-01T15:49:08.000Z","updated_at":"2023-07-11T21:00:38.000Z","dependencies_parsed_at":"2023-02-19T15:01:04.449Z","dependency_job_id":null,"html_url":"https://github.com/shystruk/publish-subscribe-js","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/shystruk/publish-subscribe-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shystruk%2Fpublish-subscribe-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shystruk%2Fpublish-subscribe-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shystruk%2Fpublish-subscribe-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shystruk%2Fpublish-subscribe-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shystruk","download_url":"https://codeload.github.com/shystruk/publish-subscribe-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shystruk%2Fpublish-subscribe-js/sbom","scorecard":{"id":822025,"data":{"date":"2025-08-11","repo":{"name":"github.com/shystruk/publish-subscribe-js","commit":"3f86a20cadd0e8f81b43ac9c73b340bb9dfd7895"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T15:50:45.696Z","repository_id":51171692,"created_at":"2025-08-23T15:50:45.697Z","updated_at":"2025-08-23T15:50:45.697Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005548,"owners_count":26083918,"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-10-10T02:00:06.843Z","response_time":62,"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":["javascript","pattern","publish","publish-subscribe","subscribe"],"created_at":"2025-03-13T10:38:43.358Z","updated_at":"2025-10-10T23:11:56.015Z","avatar_url":"https://github.com/shystruk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Publish/Subscribe [![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?original_referer=https%3A%2F%2Fpublish.twitter.com%2F\u0026ref_src=twsrc%5Etfw\u0026text=Publish%2FSubscribe%20JavaScript%20UMD%20package\u0026tw_p=tweetbutton\u0026url=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2Fpublish-subscribe-js\u0026via=shystrukk) #\n[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php) [![Build Status](https://travis-ci.org/shystruk/publish-subscribe-js.svg?branch=master)](https://travis-ci.org/shystruk/publish-subscribe-js) [![npm version](https://badge.fury.io/js/publish-subscribe-js.svg)](https://badge.fury.io/js/publish-subscribe-js) [![Known Vulnerabilities](https://snyk.io/test/github/shystruk/publish-subscribe-js/badge.svg?targetFile=package.json)](https://snyk.io/test/github/shystruk/publish-subscribe-js?targetFile=package.json)\n\nPublish/Subscribe UMD package\n\n\u003e The Publish/Subscribe pattern encourage us to think hard about the relationships between different parts of our application. They also help us identify what layers containing direct relationships which could instead be replaced with sets of subjects and observers. This effectively could be used to break down an application into smaller, more loosely coupled blocks to improve code management and potentials for re-use. ~ Addy Osmani\n\n## Getting Publish/Subscribe ##\n#### npm\n`npm install publish-subscribe-js`\n\n#### yarn\n`yarn add publish-subscribe-js`\n\n## Example ##\n```javascript\nimport PublishSubscribe from 'publish-subscribe-js'\n\n// create a function callback to subscribe to topic\nconst callback = (data, ...args) =\u003e {\n    // args will store ['TOPIC', data, data_1, data_2, ...]\n    console.log(data, args)\n}\n\nPublishSubscribe.subscribe('TOPIC', callback)\nPublishSubscribe.publish('TOPIC', data, data_1, data_2, ...)\n```\n\n### Add more subscribers to topic ###\n```javascript\n// There are no limits, one TOPIC may store subscribers how many you needed\nPublishSubscribe.subscribe('TOPIC', callback)\nPublishSubscribe.subscribe('TOPIC', callback_1)\nPublishSubscribe.subscribe('TOPIC', callback_2)\n\n// All subscribers will be called\nPublishSubscribe.publish('TOPIC')\n```\n\n### Unsubscribe specific topic ###\n```javascript\nPublishSubscribe.subscribe('TOPIC', callback)\nPublishSubscribe.unsubscribe('TOPIC')\n```\n\n### Unsubscribe specific subscriber in topic ###\n```javascript\n\nconst callbackKey = PublishSubscribe.subscribe('TOPIC', callback)\nconst callback_1Key = PublishSubscribe.subscribe('TOPIC', callback_1)\n\n// Unsubscribe only callback subscriber\nPublishSubscribe.unsubscribe('TOPIC', callbackKey)\n```\n\n### Unsubscribe all topics ###\n```javascript\nPublishSubscribe.unsubscribeAll()\n```\n\n## Contributing\n\nAny contributions you make **are greatly appreciated**.\n\nPlease read the [Contributions Guidelines](CONTRIBUTING.md) before submitting a PR.\n\n## License\n\nMIT © [Vasyl Stokolosa](https://about.me/shystruk)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshystruk%2Fpublish-subscribe-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshystruk%2Fpublish-subscribe-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshystruk%2Fpublish-subscribe-js/lists"}