Socket
Book a DemoInstallSign in
Socket

simple-rate-limit

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-rate-limit

Simple rate-limiting middleware for Express. Use to limit the number of simultaneous open requests.

1.0.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Simple Rate Limit

Simple rate limiting middleware for Express applications. Limit the number of open requests of your application to limit resource utilization such as socket connection and memory.

Return 429 (Too many requests) errors once there are too many open requests.

Install

npm install --save simple-rate-limit

Configuration

  • limit - The maximum number of simultaneous open requests. Requests sent once the limits is reached will receive a 429 error code.

Usage

var SimpleRateLimiter = require('simple-rate-limit');

var limiter = SimpleRateLimiter({
  limit:20 //defaults to 5
});

//for global limiting
app.use(limiter);

//Or - for limiting only specific routes
app.get('/rate-limited', limiter, function(req, res){
  ...
});

License

MIT Itamar Weiss

Keywords

express-rate-limit

FAQs

Package last updated on 17 Sep 2015

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.