express-rate-limit
Advanced tools
Comparing version 6.0.0 to 6.0.1
@@ -9,3 +9,3 @@ # Changelog | ||
## 6.0.0 | ||
## [6.0.0](https://github.com/nfriedly/express-rate-limit/releases/v6.0.0) | ||
@@ -28,2 +28,3 @@ ### Added | ||
`standardHeaders` is set. | ||
- Allow `keyGenerator` to be an async function/return a promise. | ||
- Change the way custom stores are defined. | ||
@@ -37,3 +38,4 @@ - Add the `init` method for stores to set themselves up using options passed | ||
- The package can now only be used with NodeJS version 12.9.0 or greater. | ||
- The `onLimitReached` configuration option is now deprecated. Replace it with a custom `handler` that checks the number of hits. | ||
- The `onLimitReached` configuration option is now deprecated. Replace it with a | ||
custom `handler` that checks the number of hits. | ||
@@ -40,0 +42,0 @@ ### Removed |
{ | ||
"name": "express-rate-limit", | ||
"version": "6.0.0", | ||
"version": "6.0.1", | ||
"description": "Basic IP rate-limiting middleware for Express. Use to limit repeated requests to public APIs and/or endpoints such as password reset.", | ||
@@ -31,4 +31,3 @@ "author": { | ||
"type": "module", | ||
"module": "dist/esm/index.js", | ||
"main": "dist/cjs/index.js", | ||
"types": "./dist/esm/index.d.ts", | ||
"exports": { | ||
@@ -38,18 +37,4 @@ ".": { | ||
"require": "./dist/cjs/index.js" | ||
}, | ||
"./memory-store": { | ||
"import": "./dist/esm/memory-store.js", | ||
"require": "./dist/cjs/memory-store.js" | ||
} | ||
}, | ||
"typesVersions": { | ||
"*": { | ||
".": [ | ||
"./dist/esm/index.d.ts" | ||
], | ||
"./memory-store": [ | ||
"./dist/esm/memory-store.d.ts" | ||
] | ||
} | ||
}, | ||
"files": [ | ||
@@ -59,3 +44,2 @@ "dist/", | ||
"package.json", | ||
"package-lock.json", | ||
"readme.md", | ||
@@ -70,4 +54,4 @@ "license.md", | ||
"clean": "del-cli dist/ coverage/ *.log *.tmp *.bak *.tgz", | ||
"build:cjs": "tsc --project config/typescript/cjs.json", | ||
"build:esm": "tsc --project config/typescript/esm.json", | ||
"build:cjs": "tsc --project config/typescript/cjs.json && cpy --rename package.json config/node/cjs.json dist/cjs/", | ||
"build:esm": "tsc --project config/typescript/esm.json && cpy --rename package.json config/node/esm.json dist/esm/", | ||
"build": "run-p build:*", | ||
@@ -92,2 +76,3 @@ "compile": "run-s clean build", | ||
"@types/supertest": "^2.0.11", | ||
"cpy-cli": "^3.1.1", | ||
"cross-env": "^7.0.3", | ||
@@ -94,0 +79,0 @@ "del-cli": "^4.0.1", |
@@ -278,3 +278,3 @@ # <div align="center"> Express Rate Limit </div> | ||
`request` and the `response` objects. The `next` param is available if you need | ||
to pass to the next middleware/route. Finally, the `optionsUsed` param has all | ||
to pass to the next middleware/route. Finally, the `options` param has all | ||
of the options that originally passed in when creating the current limiter and | ||
@@ -289,3 +289,3 @@ the default values for other options. | ||
```ts | ||
const handler = (request, response, next, optionsUsed) => { | ||
const handler = (request, response, next, options) => { | ||
response.status(options.statusCode).send(options.message) | ||
@@ -292,0 +292,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
158717
31
0
18