All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Export
RedisStore
as a named export.
- Enabled provenance statement generation, see https://github.com/express-rate-limit/express-rate-limit#406.
store.get()
returns 0 instead ofNaN
if there are no hits stored for the client.
- Added the
store.get()
function, to retrieve the hit count and reset time for a particular client.
- Dropped
node
v14 support. - Added support for
express-rate-limit
v7.
- Use
pkgroll
to bundle library. - Bumped dependencies.
- Retry the
EVALSHA
command if it fails the first time.
- Added the
types
field to theexport
map inpackage.json
.
- Updated documentation related to
ioredis
integration.
- Added issue and PR templates.
- The
release
action now publishes a GitHub release when a new tag is pushed with a built.tgz
file so you can install the package from npm and GitHub. - [BREAKING] Added the
sendCommand
option to replace theclient
optionsendCommand
is a function that takes the raw command as a string array and returns the numeric response from redis.- this makes the store compatible with all clients that have a public method to send raw commands to redis.
- Added a changelog and a contributing guide.
- Rewrote library and tests in Typescript.
- Use
esbuild
to build both ES and CommonJS modules and usedts-bundle-generator
to generate a single type declaration file. - Added
express
>= 4 andexpress-rate-limit
>= 6 as peer dependencies.
- [BREAKING] Removed the
expiry
option, as we now get that from the rate limiting middleware in theinit
method. - [BREAKING] Removed the
client
option, as it is now replaced by thesendCommand
option - [BREAKING] Removed the
passIfNotConnected
option, as developers now need to handle connection using a client of their choice
- Added the
passIfNotConnected
option.- If set to
true
, if the client is not connected to Redis, the store will allow the request to pass through as a failover.
- If set to
- Dropped support for Node 6.
- [BREAKING] Bumped
node-redis
version from2.8.0
to3.0.2
.
- Added support for passing a redis connection string instead of a client instance to the constructor.
- Added example of connecting to a UDP socket to the readme.
- Added support for returning the reset date to the rate limit middleware.
- Added the
resetExpiryOnChange
option.- If set to
true
, the store sets the expiry time back towindowMs
when incrementing/decrementing. This aligns better with how the default handler in the rate limiting middleware displays the time in theRetry-After
header.
- If set to
- Added support for the
decrement
andreset
functions (see https://github.com/nfriedly/express-rate-limit/commit/c9194780b6826d9cdb14b3395907cf7fb93e59f6)
- Added support for millisecond precision in the
expiry
option.
- Added better support for IORedis.