Download Latest Version AI docs fix source code.tar.gz (701.4 kB)
Email in envelope

Get an email when there's a new version of node-rate-limiter-flexible

Home / v10.0.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2026-03-14 2.0 kB
Require points and duration opts source code.tar.gz 2026-03-14 687.2 kB
Require points and duration opts source code.zip 2026-03-14 742.4 kB
Totals: 3 Items   1.4 MB 0

What's Changed

[BREAKING CHANGES]

  • Require points and duration options by @animir in https://github.com/animir/node-rate-limiter-flexible/pull/354

    No default values are set for points and duration options starting from v10. Negative points will not be replaced by default points value 4. Validation rules apply.

    Error is thrown during limiter creation if points or duration is invalid:

    1. points must be number.

      Any limiter accepts negative points as valid option starting from v10. If you migrate from older version, be careful: If in your code points option is set to negative value and that works for your project now then you should review the logic in your project. After update to version 10, negative points value will not be replaced by 4 by default as it was prior to version 10.

      When your limiter has negative or zero points consume method call is always rejected since there is always not enough points to consume. You can set points to negative and play with reward and consume calls, that could be useful sometimes.

    2. duration must be non-negative number >= 0. Error is thrown during limiter creation if duration option has invalid value.

    Requiring points and duration seems logical for security package. We don't want our apps working not as we expect even if there is no security threat. This update removes uncertaincy about negative duration and zero points.

[OTHER UPDATES]

  • Faster memory limiter and block mechanism by @animir in https://github.com/animir/node-rate-limiter-flexible/pull/355

    Internal memory storage implementation refactored for Map with timestamps instead of Date objects.

    Memory limiter is faster on 10-15% now on high traffic with diverse keys. Tests show performance improvement from 2569948 ops/sec to 2885688 ops/sec on my laptop.

Full Changelog: https://github.com/animir/node-rate-limiter-flexible/compare/v9.1.1...v10.0.0

Source: README.md, updated 2026-03-14