node-rate-limiter-flexible

Atomic counters and rate limiting tools. Limit resource access at any scale.

ISC License

Downloads
2.9M
Stars
3K
Committers
43

Bot releases are visible (Hide)

node-rate-limiter-flexible - Redis custom Lua script support Latest Release

Published by animir 6 months ago

  • 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 every upsert. See this rejected when consume more than maximum points and multiply delay test for example. Thanks to @roggervalf
  • Readme language fixes. Thanks to @DePasqualeOrg

👍

node-rate-limiter-flexible - Prisma support

Published by animir 8 months ago

What's Changed

  1. Add RateLimiterPrisma. Read about it on Wiki. Prisma supports PostgreSQL, MySQL, SQLite, MongoDB and many other databases. Thank you @animir

  2. Test environment and github actions got a number of improvements. Thank you @mroderick

  3. BREAKING CHANGES: we dropped support for Node.js 14 and all previous versions.

Full Changelog: https://github.com/animir/node-rate-limiter-flexible/compare/v4.0.1...v5.0.0

node-rate-limiter-flexible - Fix RateLimiterMongo TypeError

Published by animir 9 months ago

RateLimiterMongo TypeError: Cannot read properties of null (reading 'value') error was fixed. See https://github.com/animir/node-rate-limiter-flexible/issues/251 for reference.

Thanks to @o-ali

node-rate-limiter-flexible - DynamoDB support

Published by animir 10 months ago

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.

🐯

node-rate-limiter-flexible - Fix RateLimiterUnion.consume return type

Published by animir 10 months ago

  • RateLimiterUnion.consume return type fixed. Thanks to @Omers-Frontegg
node-rate-limiter-flexible - Fix memory storage being not accurate with expired keys

Published by animir 10 months ago

  • fix memory storage consuming points when msBeforeNext is negative (key is expired). Thank you @animir
node-rate-limiter-flexible - PostgreSQL quote table name and support for schema name option

Published by animir 12 months ago

  • 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

🍯

node-rate-limiter-flexible - Support of ioredis v4+ and redis v4+

Published by animir about 1 year ago

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:

  1. rate-limiter-flexible works with ioredis package of any version (tested versions 2, 3, 4 and 5) by default now. If you want it to work with the latest redis package, you should set useRedisPackage flag. If you use redis of version 3 or lower, you should stick to rate-limiter-flexible version 2.
  2. deprecated options started with lowercased inmemory prefix are removed. You can use inMemoryBlockOnConsumed and
    inMemoryBlockDuration instead.
  3. deprecated redis option for RateLimiterRedis was removed. (Most likely you never heard about it, since it was deprecated years ago). You should use storeClient option instead.
node-rate-limiter-flexible - TS type for the new option rejectIfRedisNotReady

Published by animir almost 2 years ago

Thank you @dmozgovoi for the quick improvement.

node-rate-limiter-flexible - Redis limiter new option `rejectIfRedisNotReady`

Published by animir almost 2 years ago

In some cases especially with insuranceLimiter set it is important to reject requests quickly based on Redis client status being not ready. Thanks @dmozgovoi

node-rate-limiter-flexible - RateLimiterUnion works with one limiter

Published by animir about 2 years ago

Thank you @svsool

node-rate-limiter-flexible - Fixes and improvements made since v2.3.4 release

Published by animir about 2 years ago

node-rate-limiter-flexible - MongoDB version detection fixes and misc

Published by animir almost 3 years ago

  • MongoDB version detection is fixed for mongoose client. Thank you @adrianvlupu
  • MongoDB version detection is fixed for 3.6.7+. Thank you @pavittarx
  • Internal fix of get method. It incorrectly processed undefined result from a store. Thank you @animir
  • .editorconfig added. Thank you @vinibeloni
  • TypeScript type for RateLimiterQueueError added. Thank you @adilhafeez
  • TypeScript type for deleteInMemoryBlockedAll method is added. Thank you @animir
node-rate-limiter-flexible - MongoDB client v4 fix, delete and new method to delete all inMemory Blocked keys

Published by animir about 3 years ago

  • replace replaceOne with findOneAndUpdate to fix a bug related to absent ops attribute in MongoDB client v4+. Thank you @vdiez
  • delete method on any store limiter deletes inMemoryBlocked key if it is there. Thank you @evan361425
  • new deleteInMemoryBlockedAll method added to clean up all blocked keys at once. Thank you @evan361425 again :-)
  • @evan361425 also added tests to cover new lines 🥇
node-rate-limiter-flexible - Support for mongodb client v4

Published by animir over 3 years ago

  • Missing get/set Typescript types added and documentation improved. Thanks @rijkvanzanten
  • mongodb client v4 support. Thank you @backflip
node-rate-limiter-flexible - PostgreSQL limiter supports TypeORM + fixes

Published by animir almost 4 years ago

node-rate-limiter-flexible - BurstyRateLimiter and RateLimiterQueue improved + RateLimiterMemory works in browser

Published by animir about 4 years ago

  • RateLimiterQueue support of tokens removed by key. (single bucket for every key)
  • Add RateLimiterQueue missing methods types. Thank you @bmenant
  • RateLimiterPostgres fixed for [email protected] update. Thank you @matomesc
  • tableCreated option for MySQL and PostgreSQL to skip checks for limiter tables.
  • BurstyRateLimiter compatible with RateLimiterQueue now. Thanks a lot to @matomesc for a big help on this.
  • RateLimiterMemory limiter works in browser now. Thanks a bunch to @cha0s. Also, thank you for test scripts improvements.
node-rate-limiter-flexible - In memory Block Strategy

Published by animir over 4 years ago

Every time consume method executed, it returns msBeforeNext milliseconds. This can be used to block key in memory for exact msBeforeNext milliseconds until points are reset on store. Set inmemoryBlockOnConsumed option and omit inmemoryBlockDuration for this feature.

node-rate-limiter-flexible - BurstyRateLimiter

Published by animir over 4 years ago

Allow traffic bursts with BurstyRateLimiter

node-rate-limiter-flexible - Redis Lua script + deprecated things removed

Published by animir over 4 years ago

Changes

  • Redis uses Lua script for expiring atomic increments. It allowed to remove a hack, which made extra queries to Redis, when TTL is not set on key set.
  • RateLimiterCluster options type fixed.

BREAKING CHANGES:

  • isWhite and isBlack getters/setters and options support removed from RLWrapperBlackAndWhite. isWhiteListed and isBlackListed options should be used instead.
  • IRateLimiterResOptions interface type removed from lib/index.d.ts. IRateLimiterRes should be used.
Package Rankings
Top 0.94% on Npmjs.org
Top 8.17% on Proxy.golang.org
Badges
Extracted from project README
npm version node version deno version