Express middleware for IP-based rate limiting with flexible configuration options and multiple storage backends
Overall
score
96%
Build a small module that constructs request-throttling middleware with different validation presets, leaning on the dependency's configurable safety checks for proxy/IP handling instead of reimplementing validations.
mode of "none" creates middleware with dependency validations disabled so questionable proxy/IP setups do not raise validation errors. @testmode of "proxyOnly" activates only proxy header/trust checks while leaving other validations off; any provided overrides flip the individual proxy header, IP format, or creation-location checks on/off and merge with that preset. @test@generates
export type ValidationMode = "strict" | "none" | "proxyOnly";
export interface ValidationOverrides {
proxyHeaders?: boolean;
ipFormat?: boolean;
creationLocation?: boolean;
}
export interface ValidationBuildResult {
middleware: unknown;
validationConfig: Record<"proxyHeaders" | "ipFormat" | "creationLocation", boolean>;
}
export function buildValidationLimiter(
mode?: ValidationMode,
overrides?: ValidationOverrides
): ValidationBuildResult;Rate limiting middleware that supports configurable validation toggles around IP handling and proxy safety.
Install with Tessl CLI
npx tessl i tessl/npm-express-rate-limitevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10