Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 766 Bytes

README.md

File metadata and controls

30 lines (20 loc) · 766 Bytes

Precise Memory Rate Limit

Precise memory store for express-rate-limit.

Npm version

Install

$ npm install --save precise-memory-rate-limit

Example

const rateLimit = require("express-rate-limit")
const MemoryStore = require("precise-memory-rate-limit")

const max = 10

const limiter = rateLimit({
    store: new MemoryStore(max),
    windowMs: 15 * 60 * 1000,
    max: max // Make sure this is the same as the max passed into the MemoryStore constructor
})

app.use(limiter)

precise-memory-ratelimit does not currently support using a middleware for the max