express-slow-down
Advanced tools
Changelog
v2.0.1
WRN_ERL_MAX_ZERO
warning when supplying a custom
validation object in the config.Changelog
v2.0.0
express-slow-down v2 is built on top of express-rate-limit v7.
delayMs
when set to a number
delayMs
value by the number of slowed
requests to determine the delay amountfunction(used) { return (used - this.delayAfter) * 1000; }
to
restore old behavior. (Change 1000
to match old value if necessary.)delayMs
when set to a function
function(req, res): number
function(used, req, res): number | Promise<number>
where
used
is the number of hits from this user during the current windowonLimitReached
methodheaders
optionreq.slowDown.current
to req.slowDown.used
current
is now a hidden getter that will return the used
value, but will
not be included when iteration over keys or running through
JSON.stringify()
delayAfter
, delayMs
, and maxDelayMs
may now be async functions that
return a number or a promise that resolves to a number