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 4.0.2 to 4.0.3

57

index.d.ts

@@ -1,32 +0,39 @@

import { RequestHandler, Request, Response, NextFunction } from 'express';
import {RequestHandler, Request, Response, NextFunction} from 'express';
export interface Options {
max?: number;
message?: any;
headers?: boolean;
windowMs?: number;
store?: Store | any;
statusCode?: number;
skipFailedRequests?: boolean;
skipSuccessfulRequests?: boolean;
skip?(req?: Request, res?: Response): boolean;
onLimitReached?(req?: Request, res?: Response): void;
handler?(req: Request, res: Response, next?: NextFunction): void;
keyGenerator?(req: Request, res?: Response): string | Request['ip'];
max?: number;
message?: any;
headers?: boolean;
windowMs?: number;
store?: Store | any;
statusCode?: number;
skipFailedRequests?: boolean;
skipSuccessfulRequests?: boolean;
skip?(req?: Request, res?: Response): boolean;
onLimitReached?(req?: Request, res?: Response): void;
handler?(req: Request, res: Response, next?: NextFunction): void;
keyGenerator?(req: Request, res?: Response): string | Request['ip'];
}
export interface Store {
hits: {
[key: string]: number;
};
resetAll(): void;
resetTime: number;
setInterval: NodeJS.Timeout;
resetKey(key: string | any): void;
decrement(key: string | any): void;
incr(key: string | any, cb: (err?: Error, hits?: number) => void): void;
hits: {
[key: string]: number;
};
resetAll(): void;
resetTime: number;
setInterval: NodeJS.Timeout;
resetKey(key: string | any): void;
decrement(key: string | any): void;
incr(key: string | any, cb: (err?: Error, hits?: number) => void): void;
}
declare function RateLimit(options?: Options): (req: Request, res: Response, next: NextFunction) => void;
export = RateLimit;
export declare function RateLimit(options?: Options): (req: Request, res: Response, next: NextFunction) => void;
{
"name": "express-rate-limit",
"version": "4.0.2",
"version": "4.0.3",
"description": "Basic IP rate-limiting middleware for Express. Use to limit repeated requests to public APIs and/or endpoints such as password reset.",

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

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