Skip to content

Commit 3cac178

Browse files
feat: rename the package to @socket.io/redis-adapter
Following socketio/socket.io-redis-emitter@592883e Related: #389
1 parent 7931420 commit 3cac178

File tree

4 files changed

+15
-20
lines changed

4 files changed

+15
-20
lines changed

Makefile

Lines changed: 0 additions & 5 deletions
This file was deleted.

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@
3434

3535
```js
3636
const io = require('socket.io')(3000);
37-
const redisAdapter = require('socket.io-redis');
37+
const redisAdapter = require('@socket.io/redis-adapter');
3838
io.adapter(redisAdapter({ host: 'localhost', port: 6379 }));
3939
```
4040

4141
### ES6 modules
4242

4343
```js
4444
import { Server } from 'socket.io';
45-
import redisAdapter from 'socket.io-redis';
45+
import redisAdapter from '@socket.io/redis-adapter';
4646

4747
const io = new Server(3000);
4848
io.adapter(redisAdapter({ host: 'localhost', port: 6379 }));
@@ -53,7 +53,7 @@ io.adapter(redisAdapter({ host: 'localhost', port: 6379 }));
5353
```ts
5454
// npm i -D @types/redis
5555
import { Server } from 'socket.io';
56-
import { createAdapter } from 'socket.io-redis';
56+
import { createAdapter } from '@socket.io/redis-adapter';
5757
import { RedisClient } from 'redis';
5858

5959
const io = new Server(8080);
@@ -63,7 +63,7 @@ const subClient = pubClient.duplicate();
6363
io.adapter(createAdapter({ pubClient, subClient }));
6464
```
6565

66-
By running Socket.IO with the `socket.io-redis` adapter you can run
66+
By running Socket.IO with the `@socket.io/redis-adapter` adapter you can run
6767
multiple Socket.IO instances in different processes or servers that can
6868
all broadcast and emit events to and from each other.
6969

@@ -248,7 +248,7 @@ Access the `pubClient` and `subClient` properties of the
248248
Redis Adapter instance to subscribe to its `error` event:
249249

250250
```js
251-
const adapter = require('socket.io-redis')('localhost:6379');
251+
const adapter = require('@socket.io/redis-adapter')('localhost:6379');
252252
adapter.pubClient.on('error', function(){});
253253
adapter.subClient.on('error', function(){});
254254
```
@@ -258,7 +258,7 @@ also be forwarded to the adapter instance:
258258

259259
```js
260260
const io = require('socket.io')(3000);
261-
const redisAdapter = require('socket.io-redis');
261+
const redisAdapter = require('@socket.io/redis-adapter');
262262
io.adapter(redisAdapter({ host: 'localhost', port: 6379 }));
263263
io.of('/').adapter.on('error', function(){});
264264
```
@@ -271,7 +271,7 @@ a connection string.
271271

272272
```js
273273
const redis = require('redis');
274-
const redisAdapter = require('socket.io-redis');
274+
const redisAdapter = require('@socket.io/redis-adapter');
275275
const pubClient = redis.createClient(port, host, { auth_pass: "pwd" });
276276
const subClient = pubClient.duplicate();
277277
io.adapter(redisAdapter({ pubClient, subClient }));
@@ -283,7 +283,7 @@ io.adapter(redisAdapter({ pubClient, subClient }));
283283

284284
```js
285285
const io = require('socket.io')(3000);
286-
const redisAdapter = require('socket.io-redis');
286+
const redisAdapter = require('@socket.io/redis-adapter');
287287
const Redis = require('ioredis');
288288

289289
const startupNodes = [
@@ -307,7 +307,7 @@ io.adapter(redisAdapter({
307307

308308
```js
309309
const io = require('socket.io')(3000);
310-
const redisAdapter = require('socket.io-redis');
310+
const redisAdapter = require('@socket.io/redis-adapter');
311311
const Redis = require('ioredis');
312312

313313
const options = {
@@ -326,7 +326,7 @@ io.adapter(redisAdapter({
326326

327327
## Protocol
328328

329-
The `socket.io-redis` adapter broadcasts and receives messages on particularly named Redis channels. For global broadcasts the channel name is:
329+
The `@socket.io/redis-adapter` adapter broadcasts and receives messages on particularly named Redis channels. For global broadcasts the channel name is:
330330
```
331331
prefix + '#' + namespace + '#'
332332
```
@@ -343,7 +343,7 @@ prefix + '#' + namespace + '#' + room + '#'
343343

344344
A number of other libraries adopt this protocol including:
345345

346-
- [socket.io-emitter](https://github.com/socketio/socket.io-emitter)
346+
- [socket.io-redis-emitter](https://github.com/socketio/socket.io-redis-emitter)
347347
- [socket.io-python-emitter](https://github.com/GameXG/socket.io-python-emitter)
348348
- [socket.io-emitter-go](https://github.com/stackcats/socket.io-emitter-go)
349349

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"name": "socket.io-redis",
2+
"name": "@socket.io/redis-adapter",
33
"version": "6.1.0",
4-
"description": "",
4+
"description": "The Socket.IO Redis adapter, allowing to broadcast events between several Socket.IO servers",
55
"license": "MIT",
66
"repository": {
77
"type": "git",
8-
"url": "[email protected]:socketio/socket.io-redis.git"
8+
"url": "[email protected]:socketio/socket.io-redis-adapter.git"
99
},
1010
"files": [
1111
"dist/"

0 commit comments

Comments
 (0)