{"id":14978172,"url":"https://github.com/socketio/socket.io-redis-emitter","last_synced_at":"2026-03-27T02:44:32.176Z","repository":{"id":14798320,"uuid":"17520472","full_name":"socketio/socket.io-redis-emitter","owner":"socketio","description":"The Socket.IO Redis emitter, allowing to communicate with a group of Socket.IO servers from another Node.js process.","archived":false,"fork":false,"pushed_at":"2024-06-19T06:14:33.000Z","size":301,"stargazers_count":722,"open_issues_count":12,"forks_count":119,"subscribers_count":94,"default_branch":"main","last_synced_at":"2026-03-18T01:08:45.162Z","etag":null,"topics":["redis","socket-io"],"latest_commit_sha":null,"homepage":"https://socket.io/docs/v4/redis-adapter/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"realgud/realgud-old-debuggers","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/socketio.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":"2014-03-07T16:44:13.000Z","updated_at":"2026-02-03T03:51:48.000Z","dependencies_parsed_at":"2024-01-23T21:30:06.607Z","dependency_job_id":"15e1de80-ae9e-427a-93ae-98beba2dd04d","html_url":"https://github.com/socketio/socket.io-redis-emitter","commit_stats":{"total_commits":79,"total_committers":19,"mean_commits":4.157894736842105,"dds":0.5569620253164558,"last_synced_commit":"bfefbdefd963b59279b7f55673a88296a660f7d8"},"previous_names":["socketio/socket.io-emitter","automattic/socket.io-emitter"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/socketio/socket.io-redis-emitter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-redis-emitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-redis-emitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-redis-emitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-redis-emitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/socketio","download_url":"https://codeload.github.com/socketio/socket.io-redis-emitter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-redis-emitter/sbom","scorecard":{"id":18085,"data":{"date":"2025-08-04","repo":{"name":"github.com/socketio/socket.io-redis-emitter","commit":"bfefbdefd963b59279b7f55673a88296a660f7d8"},"scorecard":{"version":"v5.2.1-28-gc1d103a9","commit":"c1d103a9bb9f635ec7260bf9aa0699466fa4be0e"},"score":3,"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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#maintained"}},{"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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 2/23 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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#code-review"}},{"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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/socketio/socket.io-redis-emitter/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/socketio/socket.io-redis-emitter/ci.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#pinned-dependencies"}},{"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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#fuzzing"}},{"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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/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/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/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 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"13 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-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-q9mw-68c2-j6m5","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-25hc-qcg6-38wj","Warn: Project is vulnerable to: GHSA-cqmj-92xf-r6r9","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-14T16:13:02.924Z","repository_id":14798320,"created_at":"2025-08-14T16:13:02.924Z","updated_at":"2025-08-14T16:13:02.924Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31011889,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-27T02:33:22.146Z","status":"ssl_error","status_checked_at":"2026-03-27T02:33:21.763Z","response_time":164,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["redis","socket-io"],"created_at":"2024-09-24T13:56:59.049Z","updated_at":"2026-03-27T02:44:32.155Z","avatar_url":"https://github.com/socketio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# The Socket.IO Redis emitter\n\n[![Build Status](https://github.com/socketio/socket.io-redis-emitter/workflows/CI/badge.svg)](https://github.com/socketio/socket.io-redis-emitter/actions)\n[![NPM version](https://badge.fury.io/js/%40socket.io%2Fredis-emitter.svg)](https://www.npmjs.com/package/@socket.io/redis-emitter)\n\nThe `@socket.io/redis-emitter` package allows you to easily communicate with a group of Socket.IO servers from another Node.js process (server-side).\n\n![Emitter diagram](./assets/emitter.png)\n\nThe emitter is also available in other programming languages:\n\n- Java: https://github.com/sunsus/socket.io-java-emitter\n- Python: https://pypi.org/project/socket.io-emitter/\n- PHP: https://github.com/rase-/socket.io-php-emitter\n- Golang: https://github.com/yosuke-furukawa/socket.io-go-emitter\n- Perl: https://metacpan.org/pod/SocketIO::Emitter\n- Rust: https://github.com/epli2/socketio-rust-emitter\n\nIt must be used in conjunction with [`@socket.io/redis-adapter`](https://github.com/socketio/socket.io-redis-adapter/).\n\nThe current version is compatible with both:\n\n- `socket.io-redis@5` (`socket.io@2`)\n- `socket.io-redis@6` (`socket.io@3` \u0026 `socket.io@4`)\n\n## Table of content\n\n- [How to use](#how-to-use)\n  - [CommonJS](#commonjs)\n  - [TypeScript](#typescript)\n- [Emit cheatsheet](#emit-cheatsheet)\n- [API](#api)\n  - [Emitter(client[, opts])](#emitterclient-opts)\n  - [Emitter#to(room)](#emittertoroomstringbroadcastoperator)\n  - [Emitter#in(room)](#emitterinroomstringbroadcastoperator)\n  - [Emitter#except(room)](#emitterexceptroomstringbroadcastoperator)\n  - [Emitter#of(namespace)](#emitterofnamespacestringemitter)\n  - [Emitter#socketsJoin()](#emittersocketsjoinroomsstringstring)\n  - [Emitter#socketsLeave()](#emittersocketsleaveroomsstringstring)\n  - [Emitter#disconnectSockets()](#emitterdisconnectsocketscloseboolean)\n- [Migrating from `socket.io-emitter`](#migrating-from-socketio-emitter)\n- [License](#license)\n\n## How to use\n\nInstallation:\n\n```\nnpm i @socket.io/redis-emitter redis\n```\n\n### CommonJS\n\n```js\nconst { Emitter } = require(\"@socket.io/redis-emitter\");\nconst { createClient } = require(\"redis\"); // not included, needs to be explicitly installed\n\nconst redisClient = createClient();\n\nredisClient.connect().then(() =\u003e {\n  const io = new Emitter(redisClient);\n\n  setInterval(() =\u003e {\n    io.emit(\"time\", new Date);\n  }, 5000);\n})\n```\n\nWith `redis@3`, calling `connect()` is not needed:\n\n```js\nconst { Emitter } = require(\"@socket.io/redis-emitter\");\nconst { createClient } = require(\"redis\"); // not included, needs to be explicitly installed\n\nconst redisClient = createClient();\n\nconst io = new Emitter(redisClient);\n\nsetInterval(() =\u003e {\n  io.emit(\"time\", new Date);\n}, 5000);\n```\n\n### TypeScript\n\n```ts\nimport { Emitter } from \"@socket.io/redis-emitter\";\nimport { createClient } from \"redis\";\n\nconst redisClient = createClient();\n\nredisClient.connect().then(() =\u003e {\n  const io = new Emitter(redisClient);\n\n  setInterval(() =\u003e {\n    io.emit(\"time\", new Date);\n  }, 5000);\n});\n```\n\nWith typed events:\n\n```ts\nimport { Emitter } from \".\";\nimport { createClient } from \"redis\";\n\ninterface Events {\n  basicEmit: (a: number, b: string, c: number[]) =\u003e void;\n}\n\nconst redisClient = createClient();\n\nredisClient.connect().then(() =\u003e {\n  const io = new Emitter\u003cEvents\u003e(redisClient);\n\n  io.emit(\"basicEmit\", 1, \"2\", [3]);\n});\n```\n\n## Emit cheatsheet\n\n```js\nconst { Emitter } = require(\"@socket.io/redis-emitter\");\nconst { createClient } = require(\"redis\"); // not included, needs to be explicitly installed\n\nconst redisClient = createClient();\nconst io = new Emitter(redisClient);\n\n// sending to all clients\nio.emit(/* ... */);\n\n// sending to all clients in 'room1' room\nio.to(\"room1\").emit(/* ... */);\n\n// sending to all clients in 'room1' except those in 'room2'\nio.to(\"room1\").except(\"room2\").emit(/* ... */);\n\n// sending to individual socketid (private message)\nio.to(socketId).emit(/* ... */);\n\nconst nsp = io.of(\"/admin\");\n\n// sending to all clients in 'admin' namespace\nnsp.emit(/* ... */);\n\n// sending to all clients in 'admin' namespace and in 'notifications' room\nnsp.to(\"notifications\").emit(/* ... */);\n```\n\n**Note:** acknowledgements are not supported\n\n## API\n\n### Emitter(client[, opts])\n\n`client` is a [node_redis](https://github.com/mranney/node_redis)\ncompatible client that has been initialized with the `return_buffers`\noption set to `true`.\n\nThe following options are allowed:\n\n- `key`: the name of the key to pub/sub events on as prefix (`socket.io`)\n- `parser`: parser to use for encoding messages to Redis ([`notepack.io](https://www.npmjs.com/package/notepack.io))\n\n### Emitter#to(room:String):BroadcastOperator\n### Emitter#in(room:String):BroadcastOperator\n\nSpecifies a specific `room` that you want to emit to.\n\n### Emitter#except(room:String):BroadcastOperator\n\nSpecifies a specific `room` that you want to exclude from broadcasting.\n\n### Emitter#of(namespace:String):Emitter\n\nSpecifies a specific namespace that you want to emit to.\n\n### Emitter#socketsJoin(rooms:String|String[])\n\nMakes the matching socket instances join the specified rooms:\n\n```js\n// make all Socket instances join the \"room1\" room\nio.socketsJoin(\"room1\");\n\n// make all Socket instances of the \"admin\" namespace in the \"room1\" room join the \"room2\" room\nio.of(\"/admin\").in(\"room1\").socketsJoin(\"room2\");\n```\n\n### Emitter#socketsLeave(rooms:String|String[])\n\nMakes the matching socket instances leave the specified rooms:\n\n```js\n// make all Socket instances leave the \"room1\" room\nio.socketsLeave(\"room1\");\n\n// make all Socket instances of the \"admin\" namespace in the \"room1\" room leave the \"room2\" room\nio.of(\"/admin\").in(\"room1\").socketsLeave(\"room2\");\n```\n\n### Emitter#disconnectSockets(close:boolean)\n\nMakes the matching socket instances disconnect:\n\n```js\n// make all Socket instances disconnect\nio.disconnectSockets();\n\n// make all Socket instances of the \"admin\" namespace in the \"room1\" room disconnect\nio.of(\"/admin\").in(\"room1\").disconnectSockets();\n\n// this also works with a single socket ID\nio.of(\"/admin\").in(theSocketId).disconnectSockets();\n```\n\n## Migrating from `socket.io-emitter`\n\nThe package was renamed from `socket.io-emitter` to `@socket.io/redis-emitter` in [v4](https://github.com/socketio/socket.io-redis-emitter/releases/tag/4.0.0), in order to better reflect the relationship with Redis.\n\nTo migrate to the new package, you'll need to make sure to provide your own Redis clients, as the package will no longer create Redis clients on behalf of the user.\n\nBefore:\n\n```js\nconst io = require(\"socket.io-emitter\")({ host: \"127.0.0.1\", port: 6379 });\n```\n\nAfter:\n\n```js\nconst { Emitter } = require(\"@socket.io/redis-emitter\");\nconst { createClient } = require(\"redis\");\n\nconst redisClient = createClient();\nconst io = new Emitter(redisClient);\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocketio%2Fsocket.io-redis-emitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsocketio%2Fsocket.io-redis-emitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocketio%2Fsocket.io-redis-emitter/lists"}