Skip to content

Commit 5e88ff6

Browse files
committed
docs: fix ioredis sendCommand function
- closes #217
1 parent 893ec78 commit 5e88ff6

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

readme.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ To use it with a [`ioredis`](https://github.com/luin/ioredis) client:
9999

100100
```ts
101101
import { rateLimit } from 'express-rate-limit'
102-
import { RedisStore } from 'rate-limit-redis'
102+
import { RedisStore, type RedisReply } from 'rate-limit-redis'
103103
import RedisClient from 'ioredis'
104104

105105
// Create a `ioredis` client
@@ -117,7 +117,7 @@ const limiter = rateLimit({
117117
// Redis store configuration
118118
store: new RedisStore({
119119
sendCommand: (command: string, ...args: string[]) =>
120-
client.send_command(command, ...args),
120+
client.call(command, ...args) as Promise<RedisReply>,
121121
}),
122122
})
123123
app.use(limiter)
@@ -137,15 +137,15 @@ follows:
137137
The raw command sending function varies from library to library; some are given
138138
below:
139139

140-
| Library | Function |
141-
| ------------------------------------------------------------------ | ------------------------------------------------------------------------------------- |
142-
| [`node-redis`](https://github.com/redis/node-redis) | `async (...args: string[]) => client.sendCommand(args)` |
143-
| [`ioredis`](https://github.com/luin/ioredis) | `async (command: string, ...args: string[]) => client.send_command(command, ...args)` |
144-
| [`handy-redis`](https://github.com/mmkal/handy-redis) | `async (...args: string[]) => client.nodeRedis.sendCommand(args)` |
145-
| [`tedis`](https://github.com/silkjs/tedis) | `async (...args: string[]) => client.command(...args)` |
146-
| [`redis-fast-driver`](https://github.com/h0x91b/redis-fast-driver) | `async (...args: string[]) => client.rawCallAsync(args)` |
147-
| [`yoredis`](https://github.com/djanowski/yoredis) | `async (...args: string[]) => (await client.callMany([args]))[0]` |
148-
| [`noderis`](https://github.com/wallneradam/noderis) | `async (...args: string[]) => client.callRedis(...args)` |
140+
| Library | Function |
141+
| ------------------------------------------------------------------ | ----------------------------------------------------------------------------- |
142+
| [`node-redis`](https://github.com/redis/node-redis) | `async (...args: string[]) => client.sendCommand(args)` |
143+
| [`ioredis`](https://github.com/luin/ioredis) | `async (command: string, ...args: string[]) => client.call(command, ...args)` |
144+
| [`handy-redis`](https://github.com/mmkal/handy-redis) | `async (...args: string[]) => client.nodeRedis.sendCommand(args)` |
145+
| [`tedis`](https://github.com/silkjs/tedis) | `async (...args: string[]) => client.command(...args)` |
146+
| [`redis-fast-driver`](https://github.com/h0x91b/redis-fast-driver) | `async (...args: string[]) => client.rawCallAsync(args)` |
147+
| [`yoredis`](https://github.com/djanowski/yoredis) | `async (...args: string[]) => (await client.callMany([args]))[0]` |
148+
| [`noderis`](https://github.com/wallneradam/noderis) | `async (...args: string[]) => client.callRedis(...args)` |
149149

150150
#### `prefix`
151151

0 commit comments

Comments
 (0)