{"id":21097578,"url":"https://github.com/nishanbajracharya/socket-helper","last_synced_at":"2026-04-21T10:04:23.927Z","repository":{"id":35026683,"uuid":"197971085","full_name":"nishanbajracharya/socket-helper","owner":"nishanbajracharya","description":"Socket.io helper utilities with events inspired by flux standard actions","archived":false,"fork":false,"pushed_at":"2023-01-04T04:57:03.000Z","size":963,"stargazers_count":0,"open_issues_count":15,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-17T02:25:12.857Z","etag":null,"topics":["socket-io"],"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/nishanbajracharya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-20T19:06:03.000Z","updated_at":"2020-05-07T09:06:01.000Z","dependencies_parsed_at":"2023-01-15T12:18:01.530Z","dependency_job_id":null,"html_url":"https://github.com/nishanbajracharya/socket-helper","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nishanbajracharya/socket-helper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nishanbajracharya%2Fsocket-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nishanbajracharya%2Fsocket-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nishanbajracharya%2Fsocket-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nishanbajracharya%2Fsocket-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nishanbajracharya","download_url":"https://codeload.github.com/nishanbajracharya/socket-helper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nishanbajracharya%2Fsocket-helper/sbom","scorecard":{"id":688975,"data":{"date":"2025-08-11","repo":{"name":"github.com/nishanbajracharya/socket-helper","commit":"6329bd095ada90c7e5f18ed12e92fe6201f9a6f2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"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":"Code-Review","score":0,"reason":"Found 0/21 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":"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":"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":"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":"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":"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":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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 4 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"}},{"name":"Vulnerabilities","score":0,"reason":"60 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-j4f2-536g-r55m","Warn: Project is vulnerable to: GHSA-r7qp-cfhv-p84w","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-6fx8-h7jm-663j","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-fxwf-4rqh-v8g3","Warn: Project is vulnerable to: GHSA-25hc-qcg6-38wj","Warn: Project is vulnerable to: GHSA-xfhh-g9f5-x4m4","Warn: Project is vulnerable to: GHSA-qm95-pgcg-qqfq","Warn: Project is vulnerable to: GHSA-cqmj-92xf-r6r9","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-72mh-269x-7mh5","Warn: Project is vulnerable to: GHSA-h4j5-c7cj-74xg","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T01:48:25.650Z","repository_id":35026683,"created_at":"2025-08-22T01:48:25.650Z","updated_at":"2025-08-22T01:48:25.650Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018626,"owners_count":26086404,"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-14T02:00:06.444Z","response_time":60,"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":["socket-io"],"created_at":"2024-11-19T22:48:49.635Z","updated_at":"2025-10-14T09:35:17.106Z","avatar_url":"https://github.com/nishanbajracharya.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Socket Helper\n\nSocket.io helper utilities with events inspired by flux standard actions. This package is targeted towards socket server applications and not client applications.\n\n## Why Socket Helper?\n\nSocketIO provides a large set of tools to run websocket servers with ease. What Socket Helper provides is a wrapper for SocketIO with `connection`, `new connection`, `disconnection` and basic `message` events preconfigured.\n\n## Installation\n\nThe package is available in the npm registry. To install, use `npm` or `yarn`.\n\n```sh\n$ npm install --save socket-helper\n\n$ yarn add socket-helper\n```\n\n## Usage\n\nOnce installed, make sure that `socket.io` is also installed as this package does not come with it. This will **not** work without `socket.io`.\n\n### Basic Usage\n\nTo use Socket Helper, pass `io` from `socket.io` into it.\n\n```js\nvar io = require('socket.io')(http);\n\nvar socketHelper = require('socket-helper');\n\nsocketHelper(io);\n```\n\n### Custom Listeners\n\nSocket Helper comes with connection and disconnection event listeners by default. We can add our own listeners in addition to the existing ones.\n\n```js\nfunction onConnection(socket, payload) {\n  console.log('Connected', payload);\n}\n\nfunction onDisconnection(socket, payload) {\n  console.log('Disconnected', payload);\n}\n\nsocketHelper(io, onConnection, onDisconnection);\n```\n\n### Configs and Overrides\n\nWe can customize the default configs used by Socket Helper by providing a custom config.\n\n```js\nvar config = {\n  clients: [],\n  overrides: {\n    message: true,\n    connection: true,\n    disconnection: true,\n    newConnection: true\n  }\n};\n\nsocketHelper(io, onConnection, onDisconnection, config);\n```\n\n#### `clients`\n\nThe clients key stores the ids of currently active connections.\n\n#### `overrides`\n\nOverrides define whether in-built event handlers for `message`, `connection`, `disconnection` and `newConnection` are disabled or not.\n\n## API\n\nWhen a new connection is established, the socket server emits two events, one for the new connection and another for all other connected clients.\n\nThe data send with the socket event will be FSA compliant, i.e., will have the following format:\n\n```js\n{\n  type: 'TYPE',\n  payload: {\n  }\n}\n```\n\nThe socket event will always emit events of name `message`. The data with the event will carry the information about how the event should be handled, similar to Flux actions.\n\n### CONNECTION\n\n| Event     | Type             | Payload                 |\n| --------- | ---------------- | ----------------------- |\n| `message` | `CONNECTION`     | `{ clientID, clients }` |\n| `message` | `NEW_CONNECTION` | `{ clientID, clients }` |\n\n### DISCONNECTION\n\n| Event     | Type            | Payload                 |\n| --------- | --------------- | ----------------------- |\n| `message` | `DISCONNECTION` | `{ clientID, clients }` |\n\n### MESSAGE\n\nThe server is configured by default to listen for and respond to events with name `message`. So when a client emits a `message` event, the server responds to it by broadcasting the message to all the clients including the sender.\n\n| Event     | Type      | Payload                                                     |\n| --------- | --------- | ----------------------------------------------------------- |\n| `message` | `MESSAGE` | `{clientID, clients, event: data.type, data: data.payload}` |\n\nThe server expects client to also send the `message` event with data in FSA format. The data sent by client, will be mapped as `event: type` and `data: payload` when it is sent to all connected clients.\n\n## Contributing\n\nTo contribute, follow one of the two options:\n\n- **Open an Issue**\n\n  Open an issue detailing:\n\n  1. What the issue is\n  2. Steps to reproduce\n  3. Possible solutions\n\n  Note: These details are recommended but are entirely optional.\n\n- **Send a Pull Request**\n\n  Fork this project and send a pull request to the `master` branch.\n\n## LICENSE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnishanbajracharya%2Fsocket-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnishanbajracharya%2Fsocket-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnishanbajracharya%2Fsocket-helper/lists"}