
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
ip-access-limiter
Advanced tools
A simple, fast IP rate limiter for Express/Node with in-memory and Redis support.
A simple and efficient IP access limiter middleware for Express/Node.js applications. This project provides a lightweight solution for limiting the number of requests from individual IP addresses, helping to prevent abuse and ensure fair usage of your API.
To install IP Access Limiter, run the following command:
npm install ip-access-limiter
import express from 'express';
import { rateLimiter } from 'ip-access-limiter';
const app = express();
const PORT = process.env.PORT || 3000;
// Apply the rate limiter middleware
app.use(rateLimiter({
windowMs: 15 * 60 * 1000, // 15 minutes
max: 100 // limit each IP to 100 requests per windowMs
}));
app.get('/', (req, res) => {
res.send('Hello, world!');
});
app.listen(PORT, () => {
console.log(`Server is running on http://localhost:${PORT}`);
});
You can customize the rate limiter by passing options to the middleware:
windowMs: The time window for which requests are checked (in milliseconds).max: The maximum number of requests allowed per IP within the time window.store: Optionally specify a custom store (e.g., RedisStore or MemoryStore).Refer to the example application located in the examples/express-app/app.ts file for a complete implementation.
The rate limiter includes a logging utility that can be configured to log events such as blocked IPs and request counts. You can customize the logging behavior in the src/utils/logger.ts file.
Unit tests for the rate limiter functionality can be found in the test/rateLimiter.test.ts file. To run the tests, use the following command:
npm test
Contributions are welcome! Please feel free to submit a pull request or open an issue for any enhancements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for more details.
FAQs
A simple, fast IP rate limiter for Express/Node with in-memory and Redis support.
The npm package ip-access-limiter receives a total of 3 weekly downloads. As such, ip-access-limiter popularity was classified as not popular.
We found that ip-access-limiter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.