Releases: animir/node-rate-limiter-flexible
Redis custom Lua script support
- RateLimiterRedis supports for
customIncrTtlLuaScript
option now. You can set custom Lua script as a string. It will be executed instead of built-in Lua script that is called on everyupsert
. See this rejected when consume more than maximum points and multiply delay test for example. Thanks to @roggervalf - Readme language fixes. Thanks to @DePasqualeOrg
👍
Prisma support
What's Changed
-
Add
RateLimiterPrisma
. Read about it on Wiki. Prisma supports PostgreSQL, MySQL, SQLite, MongoDB and many other databases. Thank you @animir -
Test environment and github actions got a number of improvements. Thank you @mroderick
-
BREAKING CHANGES: we dropped support for
Node.js 14
and all previous versions.
Full Changelog: v4.0.1...v5.0.0
Fix RateLimiterMongo TypeError
DynamoDB support
Thanks to @Daniel-97 rate-limiter-flexible
supports DynamoDB now!
Usage example can be found here.
BREAKING CHANGES: we dropped support for Node.js 12 and previous versions.
🐯
Fix RateLimiterUnion.consume return type
- RateLimiterUnion.consume return type fixed. Thanks to @Omers-Frontegg
Fix memory storage being not accurate with expired keys
- fix memory storage consuming points when msBeforeNext is negative (key is expired). Thank you @animir
PostgreSQL quote table name and support for schema name option
- use quotation for table name in RateLimiterPostgres queries. Thanks to @komachi
- add optional
schemaName
to RateLimiterPostgres limiter. Thanks to @paulsc54 - special thanks to @roggervalf who configured Github Actions for tests
🍯
Support of ioredis v4+ and redis v4+
I have really great news!
rate-limiter-flexible
supports ioredis
v4+ and redis
v4+ now.
We have been waiting for this moment for years.
Thanks to @roggervalf. And one big thank you from me personally
Since this is major release, there are
BREAKING CHANGES:
rate-limiter-flexible
works withioredis
package of any version (tested versions 2, 3, 4 and 5) by default now.
- If you want it to work with the
redis
package version 4 or later, you should set useRedisPackage flag. - If you created
redis
client withlegacyMode: true
, you should remove it. - If you use
redis
of version 3 or lower, you should stick torate-limiter-flexible
version 2. Or try the experimental useRedis3AndLowerPackage option.
- deprecated options started with lowercased
inmemory
prefix are removed. You can use inMemoryBlockOnConsumed and
inMemoryBlockDuration instead. - deprecated
redis
option forRateLimiterRedis
was removed. (Most likely you never heard about it, since it was deprecated years ago). You should usestoreClient
option instead.
TS type for the new option rejectIfRedisNotReady
Thank you @dmozgovoi for the quick improvement.
Redis limiter new option `rejectIfRedisNotReady`
In some cases especially with insuranceLimiter set it is important to reject requests quickly based on Redis client status being not ready
. Thanks @dmozgovoi