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

express-slow-down

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-slow-down - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

4

lib/express-slow-down.js

@@ -11,2 +11,3 @@ "use strict";

delayMs: 1000, // milliseconds - base delay applied to the response - multiplied by number of recent hits for the same key.
maxDelayMs: Infinity, // milliseconds - maximum delay to be applied to the response, regardless the request count. Infinity means that the delay will grow continuously and unboundedly
skipFailedRequests: false, // Do not count failed requests (status >= 400)

@@ -57,3 +58,4 @@ skipSuccessfulRequests: false, // Do not count successful requests (status < 400)

if (current > delayAfter) {
delay = (current - delayAfter) * options.delayMs;
const unboundedDelay = (current - delayAfter) * options.delayMs;
delay = Math.min(unboundedDelay, options.maxDelayMs);
}

@@ -60,0 +62,0 @@

{
"name": "express-slow-down",
"version": "1.2.0",
"version": "1.3.0",
"description": "Basic IP rate-limiting middleware for Express that slows down responses rather than blocking the user.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/nfriedly/express-slow-down",

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