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.0 to 6.7.1

dist/index.d.cts

24

changelog.md

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

## [6.7.1](https://github.com/express-rate-limit/express-rate-limit/releases/tag/v6.7.1)
### Fixed
- Fixed compatibility with TypeScript's TypeScript new `node16` module
resolution strategy (See
[#355](https://github.com/express-rate-limit/express-rate-limit/issues/355))
### Changed
- Bumped development dependencies.
- Added `node` 20 to list of versions the CI jobs run on.
No functional changes.
## [6.7.0](https://github.com/express-rate-limit/express-rate-limit/releases/tag/v6.7.0)

@@ -14,7 +29,8 @@

- Updated links to point to new express-rate-limit organization on GitHub.
- Added advertisement to Readme for project sponsor
- Updated links to point to the new `express-rate-limit` organization on GitHub.
- Added advertisement to `readme.md` for project sponsor
[Zuplo](https://zuplo.link/express-rate-limit).
- Updated TypeScript version and other dev dependencies
- Changed CI test suite: dropped node.js 12, added node.js 19
- Updated to `typescript` version 5 and bumped other dependencies.
- Dropped `node` 12, and added `node` 19 to the list of versions the CI jobs run
on.

@@ -21,0 +37,0 @@ No functional changes.

24

dist/index.d.ts

@@ -1,2 +0,2 @@

// Generated by dts-bundle-generator v7.0.0
// Generated by dts-bundle-generator v8.0.1

@@ -12,3 +12,3 @@ import { NextFunction, Request, RequestHandler, Response } from 'express';

*/
export declare type IncrementCallback = (error: Error | undefined, totalHits: number, resetTime: Date | undefined) => void;
export type IncrementCallback = (error: Error | undefined, totalHits: number, resetTime: Date | undefined) => void;
/**

@@ -23,3 +23,3 @@ * Method (in the form of middleware) to generate/retrieve a value based on the

*/
export declare type ValueDeterminingMiddleware<T> = (request: Request, response: Response) => T | Promise<T>;
export type ValueDeterminingMiddleware<T> = (request: Request, response: Response) => T | Promise<T>;
/**

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

*/
export declare type RateLimitExceededEventHandler = (request: Request, response: Response, next: NextFunction, optionsUsed: Options) => void;
export type RateLimitExceededEventHandler = (request: Request, response: Response, next: NextFunction, optionsUsed: Options) => void;
/**

@@ -45,3 +45,3 @@ * Event callback that is triggered on a client's first request that exceeds the limit

*/
export declare type RateLimitReachedEventHandler = (request: Request, response: Response, optionsUsed: Options) => void;
export type RateLimitReachedEventHandler = (request: Request, response: Response, optionsUsed: Options) => void;
/**

@@ -53,3 +53,3 @@ * Data returned from the `Store` when a client's hit counter is incremented.

*/
export declare type IncrementResponse = {
export type IncrementResponse = {
totalHits: number;

@@ -61,3 +61,3 @@ resetTime: Date | undefined;

*/
export declare type RateLimitRequestHandler = RequestHandler & {
export type RateLimitRequestHandler = RequestHandler & {
/**

@@ -75,3 +75,3 @@ * Method to reset a client's hit counter.

*/
export declare type LegacyStore = {
export type LegacyStore = {
/**

@@ -104,3 +104,3 @@ * Method to increment a client's hit counter.

*/
export declare type Store = {
export type Store = {
/**

@@ -145,3 +145,3 @@ * Method that initializes the store, and has access to the options passed to

*/
export declare type Options = {
export type Options = {
/**

@@ -269,3 +269,3 @@ * How long we should remember the requests.

*/
export declare type AugmentedRequest = Request & {
export type AugmentedRequest = Request & {
[key: string]: RateLimitInfo;

@@ -277,3 +277,3 @@ };

*/
export declare type RateLimitInfo = {
export type RateLimitInfo = {
readonly limit: number;

@@ -280,0 +280,0 @@ readonly current: number;

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

@@ -33,5 +33,10 @@ "author": {

".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
}

@@ -51,3 +56,3 @@ },

"engines": {
"node": ">= 12.9.0"
"node": ">= 14.0.0"
},

@@ -58,3 +63,3 @@ "scripts": {

"build:esm": "esbuild --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",
"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",
"compile": "run-s clean build:*",

@@ -64,4 +69,4 @@ "lint:code": "xo --ignore test/external/",

"lint": "run-s lint:*",
"autofix:code": "xo --ignore test/external/ --fix",
"autofix:rest": "prettier --ignore-path .gitignore --ignore-unknown --write .",
"autofix:code": "run-s lint:code --fix",
"autofix:rest": "run-s lint:rest --write .",
"autofix": "run-s autofix:*",

@@ -78,21 +83,21 @@ "test:lib": "cross-env NODE_OPTIONS=--experimental-vm-modules jest",

"devDependencies": {
"@jest/globals": "29.3.1",
"@types/express": "4.17.14",
"@types/jest": "29.2.3",
"@types/node": "18.11.9",
"@jest/globals": "29.6.1",
"@types/express": "4.17.17",
"@types/jest": "29.5.2",
"@types/node": "20.4.0",
"@types/supertest": "2.0.12",
"cross-env": "7.0.3",
"del-cli": "5.0.0",
"dts-bundle-generator": "7.0.0",
"esbuild": "0.15.14",
"dts-bundle-generator": "8.0.1",
"esbuild": "0.18.11",
"express": "4.18.2",
"husky": "8.0.2",
"jest": "29.3.1",
"lint-staged": "13.0.3",
"husky": "8.0.3",
"jest": "29.6.1",
"lint-staged": "13.2.3",
"npm-run-all": "4.1.5",
"supertest": "6.3.1",
"ts-jest": "29.0.3",
"supertest": "6.3.3",
"ts-jest": "29.1.1",
"ts-node": "10.9.1",
"typescript": "4.8.4",
"xo": "0.49.0"
"typescript": "5.1.6",
"xo": "0.54.2"
},

@@ -99,0 +104,0 @@ "xo": {

@@ -358,3 +358,4 @@ # <div align="center"> Express Rate Limit </div>

Method to generate custom identifiers for clients.
Method to retrieve custom identifiers for clients, such as their IP address,
username, or API Key.

@@ -373,2 +374,6 @@ Should be a (sync/async) function that accepts the Express `request` and

> **Note** If a `keyGenerator` returns the same value for every user, it becomes
> a global rate limiter. This could be combined with a second instance of
> `express-rate-limit` to have both global and per-user limits.
### `handler`

@@ -375,0 +380,0 @@

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