express-rate-limit 7.0.0 → 7.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/changelog.md +6 -0
  2. package/package.json +23 -23
  3. package/readme.md +6 -13
package/changelog.md CHANGED
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to
7
7
  [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8
8
 
9
+ ## [7.0.1](https://github.com/express-rate-limit/express-rate-limit/releases/tag/v7.0.1)
10
+
11
+ ### Added
12
+
13
+ - Added `rate-limit-postgresql` to the `stores` list in the readme.
14
+
9
15
  ## [7.0.0](https://github.com/express-rate-limit/express-rate-limit/releases/tag/v7.0.0)
10
16
 
11
17
  ### Breaking
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "express-rate-limit",
3
- "version": "7.0.0",
3
+ "version": "7.0.1",
4
4
  "description": "Basic IP rate-limiting middleware for Express. Use to limit repeated requests to public APIs and/or endpoints such as password reset.",
5
5
  "author": {
6
6
  "name": "Nathan Friedly",
@@ -76,28 +76,28 @@
76
76
  "express": "^4 || ^5"
77
77
  },
78
78
  "devDependencies": {
79
- "@express-rate-limit/prettier": "1.1.0",
80
- "@express-rate-limit/tsconfig": "1.0.0",
81
- "@jest/globals": "29.6.4",
82
- "@types/express": "4.17.17",
83
- "@types/jest": "29.5.4",
84
- "@types/node": "20.5.9",
85
- "@types/supertest": "2.0.12",
86
- "cross-env": "7.0.3",
87
- "del-cli": "5.1.0",
88
- "dts-bundle-generator": "8.0.1",
89
- "esbuild": "0.19.2",
90
- "express": "4.18.2",
91
- "husky": "8.0.3",
92
- "jest": "29.6.4",
93
- "lint-staged": "14.0.1",
94
- "npm-run-all": "4.1.5",
95
- "ratelimit-header-parser": "0.1.0",
96
- "supertest": "6.3.3",
97
- "ts-jest": "29.1.1",
98
- "ts-node": "10.9.1",
99
- "typescript": "5.2.2",
100
- "xo": "0.56.0"
79
+ "@express-rate-limit/prettier": "1.1.0",
80
+ "@express-rate-limit/tsconfig": "1.0.0",
81
+ "@jest/globals": "29.6.4",
82
+ "@types/express": "4.17.17",
83
+ "@types/jest": "29.5.4",
84
+ "@types/node": "20.5.9",
85
+ "@types/supertest": "2.0.12",
86
+ "cross-env": "7.0.3",
87
+ "del-cli": "5.1.0",
88
+ "dts-bundle-generator": "8.0.1",
89
+ "esbuild": "0.19.2",
90
+ "express": "4.18.2",
91
+ "husky": "8.0.3",
92
+ "jest": "29.6.4",
93
+ "lint-staged": "14.0.1",
94
+ "npm-run-all": "4.1.5",
95
+ "ratelimit-header-parser": "0.1.0",
96
+ "supertest": "6.3.3",
97
+ "ts-jest": "29.1.1",
98
+ "ts-node": "10.9.1",
99
+ "typescript": "5.2.2",
100
+ "xo": "0.56.0"
101
101
  },
102
102
  "xo": {
103
103
  "prettier": true,
package/readme.md CHANGED
@@ -422,17 +422,6 @@ const limiter = rateLimit({
422
422
  })
423
423
  ```
424
424
 
425
- ### `onLimitReached`
426
-
427
- > `function`
428
-
429
- A (sync/async) function that accepts the Express `req` and `res` objects that is
430
- called the on the request where a client has just exceeded their rate limit.
431
-
432
- This method was
433
- [deprecated in v6](https://github.com/express-rate-limit/express-rate-limit/releases/v6.0.0) -
434
- Please use a custom `handler` that checks the number of hits instead.
435
-
436
425
  ### `skip`
437
426
 
438
427
  > `function`
@@ -531,6 +520,7 @@ Here is a list of external stores:
531
520
  | [`rate-limit-memcached`](https://npmjs.org/package/rate-limit-memcached) | A [Memcached](https://memcached.org/)-backed store. | Legacy |
532
521
  | [`rate-limit-mongo`](https://www.npmjs.com/package/rate-limit-mongo) | A [MongoDB](https://www.mongodb.com/)-backed store. | Legacy |
533
522
  | [`precise-memory-rate-limit`](https://www.npmjs.com/package/precise-memory-rate-limit) | A memory store similar to the built-in one, except that it stores a distinct timestamp for each key. | Modern as of v2.0.0 |
523
+ | [`rate-limit-postgresql`](https://www.npmjs.com/package/@acpr/rate-limit-postgresql) | A [PostgreSQL](https://www.postgresql.org/)-backed store. | Modern as of v1.1.0 |
534
524
 
535
525
  Take a look at
536
526
  [this guide](https://github.com/express-rate-limit/express-rate-limit/wiki/Creating-Your-Own-Store)
@@ -553,8 +543,11 @@ The property name can be configured with the configuration option
553
543
  ### `resetKey(key)`
554
544
 
555
545
  Resets the rate limiting for a given key. An example use case is to allow users
556
- to complete a captcha or whatever to reset their rate limit, then call this
557
- method.
546
+ to complete a captcha to reset their rate limit, then call this function.
547
+
548
+ ### `getKey(key)`
549
+
550
+ Retrieves the hit count and reset time from the store for a given key.
558
551
 
559
552
  ## Issues and Contributing
560
553