Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

express-rate-limit

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-rate-limit - npm Package Compare versions

Comparing version 2.5.0 to 2.6.0

7

lib/express-rate-limit.js

@@ -20,2 +20,5 @@ 'use strict';

},
skip: function (/*req, res*/) {
return false;
},
handler: function (req, res /*, next*/) {

@@ -49,2 +52,6 @@ res.format({

function rateLimit(req, res, next) {
if (options.skip(req, res)) {
return next();
}
var key = options.keyGenerator(req, res);

@@ -51,0 +58,0 @@

4

package.json
{
"name": "express-rate-limit",
"version": "2.5.0",
"version": "2.6.0",
"description": "Basic IP rate-limiting middleware for Express. Use to limit repeated requests to public APIs and/or endpoints such as password reset.",

@@ -44,3 +44,3 @@ "homepage": "https://github.com/nfriedly/express-rate-limit",

"grunt-contrib-watch": "^1.0.0",
"grunt-mocha-cli": "^2.1.0",
"grunt-mocha-cli": "^3.0.0",
"jshint-stylish": "^2.1.0",

@@ -47,0 +47,0 @@ "load-grunt-tasks": "^3.5.0",

@@ -11,3 +11,3 @@ # Express Rate Limit

Note: this module does not share state with other processes/servers by default.
If you need a more robust solution, I recommend adding the [Redis Store][rate-limit-redis] or checking out [strict-rate-limiter](https://www.npmjs.com/package/strict-rate-limiter) or [express-brute](https://www.npmjs.com/package/express-brute), both are excellent pieces of software.
If you need a more robust solution, I recommend adding the [Redis Store][rate-limit-redis] or checking out [strict-rate-limiter](https://www.npmjs.com/package/strict-rate-limiter), [express-brute](https://www.npmjs.com/package/express-brute), or [rate-limiter](https://www.npmjs.com/package/express-limiter) - all are excellent pieces of software.

@@ -99,2 +99,8 @@

```
* **skip**: Function used to skip requests. Returning true from the function will skip limiting for that request. Defaults:
```js
function (/*req, res*/) {
return false;
}
```
* **handler**: The function to execute once the max limit is exceeded. It receives the request and the response objects. The "next" param is available if you need to pass to the next middleware. Defaults:

@@ -101,0 +107,0 @@ ```js

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc