A brute-force protection middleware for Express.js that rate-limits incoming requests using a Fibonacci sequence for increasing delays. Current stable version is 1.0.1. It provides flexible options like freeRetries, minWait, maxWait, lifetime, and custom failure callbacks. The package supports various persistent stores (e.g., Memcached, Redis) via community modules, and includes built-in MemoryStore for development. It is released under the MIT license.
npm install express-bruteVerified import paths — ran on the pinned version, not inferred.
Sets up a basic Express server with express-brute to rate-limit the /auth route, using MemoryStore and a Fibonacci backoff.
Remove proxyDepth option from ExpressBrute constructor and set trust proxy via app.set('trust proxy', <value>).Replace any calls to instance.getIPFromRequest(req) with req.ip.
Upgrade your project to use Express 4.x.
Use a persistent store like express-brute-memcached, express-brute-redis, or express-brute-mongoose.
Ensure any code relying on synchronous callback execution is updated to handle async behavior.
Explicitly set failCallback: ExpressBrute.FailTooManyRequests in options for proper rate-limit status code.
Run 'npm install express-brute' in your project directory.
Use 'const ExpressBrute = require('express-brute');' then 'new ExpressBrute.MemoryStore();'.Install a persistent store module (e.g., 'npm install express-brute-memcached') and use its store constructor.