@@ -99,7 +99,7 @@ To use it with a [`ioredis`](https://github.com/luin/ioredis) client:
9999
100100``` ts
101101import { rateLimit } from ' express-rate-limit'
102- import { RedisStore } from ' rate-limit-redis'
102+ import { RedisStore , type RedisReply } from ' rate-limit-redis'
103103import 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})
123123app .use (limiter )
@@ -137,15 +137,15 @@ follows:
137137The raw command sending function varies from library to library; some are given
138138below:
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