{"id":19124399,"url":"https://github.com/glorious-codes/glorious-rasket","last_synced_at":"2025-05-05T19:26:58.163Z","repository":{"id":41585887,"uuid":"271671005","full_name":"glorious-codes/glorious-rasket","owner":"glorious-codes","description":"A simple Pub-Sub implementation","archived":false,"fork":false,"pushed_at":"2024-01-09T17:32:20.000Z","size":3095,"stargazers_count":3,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-19T11:10:07.657Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/glorious-codes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-06-12T00:10:46.000Z","updated_at":"2023-08-16T21:01:51.000Z","dependencies_parsed_at":"2023-02-01T10:01:16.546Z","dependency_job_id":"eda49959-0f87-4c64-9760-244f3a507d6d","html_url":"https://github.com/glorious-codes/glorious-rasket","commit_stats":{"total_commits":46,"total_committers":2,"mean_commits":23.0,"dds":0.3695652173913043,"last_synced_commit":"9bf2282430040767a15c2cae88475c355c01d68e"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glorious-codes%2Fglorious-rasket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glorious-codes%2Fglorious-rasket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glorious-codes%2Fglorious-rasket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glorious-codes%2Fglorious-rasket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/glorious-codes","download_url":"https://codeload.github.com/glorious-codes/glorious-rasket/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252562030,"owners_count":21768230,"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":[],"created_at":"2024-11-09T05:29:00.714Z","updated_at":"2025-05-05T19:26:58.145Z","avatar_url":"https://github.com/glorious-codes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rasket\n\u003e A simple Pub-Sub implementation.\n\n[![CircleCI](https://circleci.com/gh/glorious-codes/glorious-rasket.svg?style=svg)](https://circleci.com/gh/glorious-codes/glorious-rasket/tree/master)\n[![Coverage Status](https://coveralls.io/repos/github/glorious-codes/glorious-rasket/badge.svg?branch=master)](https://coveralls.io/github/glorious-codes/glorious-rasket?branch=master)\n\n## Installation\n\n```\n$ npm install -S @glorious/rasket\n```\n\n## Usage\n\n### Subscribe\n\n``` javascript\n/*\n** @eventName: String [required]\n** @callback: Function [required]\n*/\n\nimport rasket from '@glorious/rasket';\n\nconst eventName = 'user:updated';\nconst callback = data =\u003e {\n  // This function will be called every time 'user:updated' is published.\n}\n\nconst subscriptionId = rasket.subscribe(eventName, callback);\n```\n\n### Unsubscribe\n\n``` javascript\n/*\n** @subscriptionId: String [required]\n*/\n\nimport rasket from '@glorious/rasket';\n\nconst subscriptionId = rasket.subscribe('event:name', data =\u003e {});\n\n// When you no longer needs to listen the event,\n// you can unsubscribe from it:\nrasket.unsubscribe(subscriptionId);\n```\n\n### Publish\n\n``` javascript\n/*\n** @eventName: String [required]\n** @data: Any [optional]\n*/\n\nimport rasket from '@glorious/rasket';\n\nconst eventName = 'user:updated';\nconst data = { name: 'John Duo', email: 'john@gmail.com' };\n\nrasket.publish(eventName, data);\n// At this moment, every piece of code subscribed on 'user:updated'\n// will be notified with that data.\n```\n\n## Contributing\n\n1. Install [Node](https://nodejs.org/en/). Download the \"Recommend for Most Users\" version.\n\n2. Clone the repo:\n``` bash\ngit clone git@github.com:glorious-codes/glorious-rasket.git\n```\n\n3. Go to the project directory:\n``` bash\ncd glorious-rasket\n```\n\n4. Install the project dependencies:\n``` bash\nnpm install\n```\n\n## Tests\n\nEnsure that all code that you have added is covered with unit tests:\n``` bash\nnpm run test -- --coverage\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglorious-codes%2Fglorious-rasket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglorious-codes%2Fglorious-rasket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglorious-codes%2Fglorious-rasket/lists"}