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 6.7.1 to 6.8.0

7

changelog.md

@@ -9,2 +9,9 @@ # Changelog

## [6.8.0](https://github.com/express-rate-limit/express-rate-limit/releases/tag/v6.8.0)
### Changed
- Added a set of validation checks to execute on the first request. (See
[#358](https://github.com/express-rate-limit/express-rate-limit/issues/358))
## [6.7.1](https://github.com/express-rate-limit/express-rate-limit/releases/tag/v6.7.1)

@@ -11,0 +18,0 @@

40

dist/index.d.ts

@@ -143,3 +143,3 @@ // Generated by dts-bundle-generator v8.0.1

*/
readonly windowMs: number;
windowMs: number;
/**

@@ -154,3 +154,3 @@ * The maximum number of connections to allow during the `window` before

*/
readonly max: number | ValueDeterminingMiddleware<number>;
max: number | ValueDeterminingMiddleware<number>;
/**

@@ -161,3 +161,3 @@ * The response body to send back when a client is rate limited.

*/
readonly message: any | ValueDeterminingMiddleware<any>;
message: any | ValueDeterminingMiddleware<any>;
/**

@@ -168,3 +168,3 @@ * The HTTP status code to send back when a client is rate limited.

*/
readonly statusCode: number;
statusCode: number;
/**

@@ -176,3 +176,3 @@ * Whether to send `X-RateLimit-*` headers with the rate limit and the number

*/
readonly legacyHeaders: boolean;
legacyHeaders: boolean;
/**

@@ -183,3 +183,3 @@ * Whether to enable support for the standardized rate limit headers (`RateLimit-*`).

*/
readonly standardHeaders: boolean;
standardHeaders: boolean;
/**

@@ -190,3 +190,3 @@ * The name of the property on the request object to store the rate limit info.

*/
readonly requestPropertyName: string;
requestPropertyName: string;
/**

@@ -198,3 +198,3 @@ * If `true`, the library will (by default) skip all requests that have a 4XX

*/
readonly skipFailedRequests: boolean;
skipFailedRequests: boolean;
/**

@@ -206,3 +206,3 @@ * If `true`, the library will (by default) skip all requests that have a

*/
readonly skipSuccessfulRequests: boolean;
skipSuccessfulRequests: boolean;
/**

@@ -213,3 +213,3 @@ * Method to generate custom identifiers for clients.

*/
readonly keyGenerator: ValueDeterminingMiddleware<string>;
keyGenerator: ValueDeterminingMiddleware<string>;
/**

@@ -221,3 +221,3 @@ * Express request handler that sends back a response when a client is

*/
readonly handler: RateLimitExceededEventHandler;
handler: RateLimitExceededEventHandler;
/**

@@ -230,3 +230,3 @@ * Express request handler that sends back a response when a client has

*/
readonly onLimitReached: RateLimitReachedEventHandler;
onLimitReached: RateLimitReachedEventHandler;
/**

@@ -238,3 +238,3 @@ * Method (in the form of middleware) to determine whether or not this request

*/
readonly skip: ValueDeterminingMiddleware<boolean>;
skip: ValueDeterminingMiddleware<boolean>;
/**

@@ -247,3 +247,3 @@ * Method to determine whether or not the request counts as 'succesful'. Used

*/
readonly requestWasSuccessful: ValueDeterminingMiddleware<boolean>;
requestWasSuccessful: ValueDeterminingMiddleware<boolean>;
/**

@@ -256,2 +256,6 @@ * The `Store` to use to store the hit count for each client.

/**
* Whether or not the validation checks should run.
*/
validate: boolean;
/**
* Whether to send `X-RateLimit-*` headers with the rate limit and the number

@@ -283,6 +287,6 @@ * of requests.

export type RateLimitInfo = {
readonly limit: number;
readonly current: number;
readonly remaining: number;
readonly resetTime: Date | undefined;
limit: number;
current: number;
remaining: number;
resetTime: Date | undefined;
};

@@ -289,0 +293,0 @@ /**

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

@@ -59,4 +59,4 @@ "author": {

"clean": "del-cli dist/ coverage/ *.log *.tmp *.bak *.tgz",
"build:cjs": "esbuild --bundle --target=es2019 --format=cjs --outfile=dist/index.cjs --footer:js=\"module.exports = rateLimit; module.exports.default = rateLimit; module.exports.rateLimit = rateLimit; module.exports.MemoryStore = MemoryStore;\" source/index.ts",
"build:esm": "esbuild --bundle --target=es2019 --format=esm --outfile=dist/index.mjs source/index.ts",
"build:cjs": "esbuild --platform=node --bundle --target=es2019 --format=cjs --outfile=dist/index.cjs --footer:js=\"module.exports = rateLimit; module.exports.default = rateLimit; module.exports.rateLimit = rateLimit; module.exports.MemoryStore = MemoryStore;\" source/index.ts",
"build:esm": "esbuild --platform=node --bundle --target=es2019 --format=esm --outfile=dist/index.mjs source/index.ts",
"build:types": "dts-bundle-generator --out-file=dist/index.d.ts source/index.ts && cp dist/index.d.ts dist/index.d.cts && cp dist/index.d.ts dist/index.d.mts",

@@ -67,6 +67,6 @@ "compile": "run-s clean build:*",

"lint": "run-s lint:*",
"autofix:code": "run-s lint:code --fix",
"autofix:rest": "run-s lint:rest --write .",
"autofix:code": "npm run lint:code -- --fix",
"autofix:rest": "npm run lint:rest -- --write .",
"autofix": "run-s autofix:*",
"test:lib": "cross-env NODE_OPTIONS=--experimental-vm-modules jest",
"test:lib": "cross-env NODE_NO_WARNINGS=1 NODE_OPTIONS=--experimental-vm-modules jest",
"test:ext": "cd test/external/ && bash run-all-tests",

@@ -112,3 +112,11 @@ "test": "run-s lint test:*",

"n/no-unsupported-features/es-syntax": 0
}
},
"overrides": [
{
"files": "test/library/*.ts",
"rules": {
"@typescript-eslint/no-unsafe-argument": 0
}
}
]
},

@@ -125,8 +133,2 @@ "prettier": {

"preset": "ts-jest/presets/default-esm",
"globals": {
"ts-jest": {
"useESM": true
}
},
"verbose": true,
"collectCoverage": true,

@@ -133,0 +135,0 @@ "collectCoverageFrom": [

@@ -454,2 +454,17 @@ # <div align="center"> Express Rate Limit </div>

### `validate`
> `boolean`
When enabled, a set of validation checks are run on the first request to detect
common misconfigurations with proxies, etc. Prints an error to the console if
any issue is detected.
Automatically disables after the first request is processed.
See https://github.com/express-rate-limit/express-rate-limit/wiki/Error-Codes
for more info.
Defaults to true.
### `store`

@@ -456,0 +471,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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