@@ -99,7 +99,7 @@ To use it with a [`ioredis`](https://github.com/luin/ioredis) client:
99
99
100
100
``` ts
101
101
import { rateLimit } from ' express-rate-limit'
102
- import { RedisStore } from ' rate-limit-redis'
102
+ import { RedisStore , type RedisReply } from ' rate-limit-redis'
103
103
import RedisClient from ' ioredis'
104
104
105
105
// Create a `ioredis` client
@@ -117,7 +117,7 @@ const limiter = rateLimit({
117
117
// Redis store configuration
118
118
store: new RedisStore ({
119
119
sendCommand : (command : string , ... args : string []) =>
120
- client .send_command (command , ... args ),
120
+ client .call (command , ... args ) as Promise < RedisReply > ,
121
121
}),
122
122
})
123
123
app .use (limiter )
@@ -137,15 +137,15 @@ follows:
137
137
The raw command sending function varies from library to library; some are given
138
138
below:
139
139
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) ` |
149
149
150
150
#### ` prefix `
151
151
0 commit comments