interface RateLimiterInit {
    blockDuration?: number;
    duration?: number;
    execEvenly?: boolean;
    execEvenlyMinDelayMs?: number;
    keyPrefix?: string;
    points?: number;
}

Properties

blockDuration?: number

Block if consumed more than points in current duration for blockDuration seconds

Default

0
duration?: number

Per seconds

Default

1
execEvenly?: boolean

Execute allowed actions evenly over duration

Default

false
execEvenlyMinDelayMs?: number

ms, works with execEvenly=true option

Default

duration * 1000 / points
keyPrefix?: string

Default

rlflx
points?: number

Number of points

Default

4