reqlim is a Connect/Express middleware designed to limit incoming requests, acting as a direct adaptation of the popular `express-rate-limit` package. Its primary function is to prevent abuse by restricting the number of requests a user can make within a specified timeframe, returning a 429 'Too Many Requests' status when limits are exceeded. Despite its utility, the package remains at an early development stage with version 0.0.0 and has not seen active development since its initial publication over four years ago. This makes it an effectively abandoned project. Developers seeking a stable, actively maintained, and feature-rich rate-limiting solution for Express applications should opt for `express-rate-limit` directly, which served as the inspiration for `reqlim` and offers continuous updates, bug fixes, and better community support, including TypeScript definitions.
npm install reqlimVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to set up `reqlim` as a global middleware for an Express application, limiting requests to 5 per minute per IP address. It includes basic configuration, a custom message, and an `onLimitReached` callback for logging.
Migrate to `express-rate-limit` which is actively maintained, feature-rich, and the upstream project `reqlim` was based on.
Use `const rateLimit = require('reqlim')` for Node.js CommonJS projects, or consider using `express-rate-limit` which often provides better ESM support or type definitions.Install `@types/reqlim` if available (unlikely for an abandoned package) or create a custom `d.ts` declaration file. The recommended fix is to use `express-rate-limit` which has official TypeScript support.
Replace `reqlim` with a well-maintained and secure alternative like `express-rate-limit` to ensure ongoing security and stability.
Ensure your project is configured for CommonJS, or use `import` syntax with a CJS interop (e.g., `import rateLimit from 'reqlim';`). The simplest solution is to use a modern, ESM-compatible rate limiter like `express-rate-limit`.
Always invoke the `rateLimit` function to get the actual middleware: `app.use(rateLimit({ ...options }))`.No dependency data recorded yet.