{"name":"express-rate-limit","version":"8.6.2","keywords":["express-rate-limit","express","rate","limit","ratelimit","rate-limit","middleware","ip","auth","authorization","security","brute","force","bruteforce","brute-force","attack"],"author":{"url":"http://nfriedly.com/","name":"Nathan Friedly"},"license":"MIT","_id":"express-rate-limit@8.6.2","maintainers":[{"name":"nfriedly","email":"nathan@nfriedly.com"},{"name":"gamemaker1","email":"gamemaker0042@gmail.com"}],"homepage":"https://github.com/express-rate-limit/express-rate-limit","bugs":{"url":"https://github.com/express-rate-limit/express-rate-limit/issues"},"dist":{"shasum":"1a6c7fb6c5f5a83883c14f1d198fcdff60087c5d","tarball":"http://registry-npm.ywwl.com/express-rate-limit/download/express-rate-limit-8.6.2.tgz","fileCount":9,"integrity":"sha512-YH4ru+eOJxQABscKFfRCy9R7x9QFGdezclVMwwgFFndzS2Xnm0uo6B0ABZsLhcpeptGv2qvuJVWlQr9gQZoC3A==","signatures":[{"sig":"MEUCIGWIPcZj6alkE9gRGZFlY6upgO1fiJBodRP22lWQ+8JIAiEAl1N4q8ZVDOCO8yyGwsOAb5R7mrHtMazl6fCnDxKVRJk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQCz9RkyLNkodmgDC7EfHTQaKN4whda9R89iKRZUWXLRbgIhANJu6+0Gp5YrfRgJZYaOEiniBzq5EXvf43VYwD0p76il","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/express-rate-limit@8.6.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":152575,"size":32598,"noattachment":false,"key":"/express-rate-limit/-/express-rate-limit-8.6.2.tgz"},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">= 16"},"exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"funding":"https://github.com/sponsors/express-rate-limit","gitHead":"c416f780b7944d1e0c67ae636a1c01a2134faba2","scripts":{"docs":"cd docs && mintlify dev","lint":"run-s lint:*","test":"run-s lint test:lib","clean":"del-cli dist/ coverage/ *.log *.tmp *.bak *.tgz","format":"run-s format:*","compile":"run-s clean build:*","prepare":"run-s compile && husky","test:ext":"cd test/external/ && bash run-all-tests","test:lib":"jest","build:cjs":"esbuild --packages=external --platform=node --bundle --target=es2022 --format=cjs --outfile=dist/index.cjs --footer:js=\"module.exports = Object.assign(rateLimit, module.exports);\" source/index.ts","build:esm":"esbuild --packages=external --platform=node --bundle --target=es2022 --format=esm --outfile=dist/index.mjs source/index.ts","lint:code":"biome check","lint:docs":"prettier --check docs/ *.md","pre-commit":"lint-staged","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","format-test":"run-s format test:lib","format:code":"biome check --write","format:docs":"prettier --write docs/ *.md"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3ab95d32-b4b7-467d-9f79-24e7891773d3"}},"prettier":"@express-rate-limit/prettier","repository":{"url":"git+https://github.com/express-rate-limit/express-rate-limit.git","type":"git"},"_npmVersion":"11.16.0","description":"Basic IP rate-limiting middleware for Express. Use to limit repeated requests to public APIs and/or endpoints such as password reset.","directories":{},"lint-staged":{"*.{md,yaml}":"prettier --write","*.{js,ts,json}":"biome check --write"},"_nodeVersion":"24.18.0","dependencies":{"debug":"^4.4.3","ip-address":"^10.2.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"30.4.2","husky":"9.1.7","del-cli":"7.0.0","esbuild":"0.28.1","express":"5.2.1","ts-jest":"29.4.12","ts-node":"10.9.2","mintlify":"4.2.743","prettier":"3.9.6","supertest":"7.2.2","typescript":"5.9.3","@types/jest":"30.0.0","@types/node":"26.1.2","lint-staged":"17.2.0","npm-run-all":"4.1.5","@types/debug":"4.1.13","@jest/globals":"30.4.1","@biomejs/biome":"2.4.6","@types/express":"5.0.6","@asyncapi/specs":"6.11.1","@types/supertest":"7.2.1","dts-bundle-generator":"8.1.2","ratelimit-header-parser":"0.1.0","@express-rate-limit/prettier":"1.1.1","@express-rate-limit/tsconfig":"1.0.5"},"peerDependencies":{"express":">= 4.11"},"_npmOperationalInternal":{"tmp":"tmp/express-rate-limit_8.6.2_1785854078269_0.39600183993727023","host":"s3://npm-registry-packages-npm-production"},"readme":"<h1 align=\"center\"> <code>express-rate-limit</code> </h1>\n\n<div align=\"center\">\n\n[![tests](https://img.shields.io/github/actions/workflow/status/express-rate-limit/express-rate-limit/ci.yaml)](https://github.com/express-rate-limit/express-rate-limit/actions/workflows/ci.yaml)\n[![npm version](https://img.shields.io/npm/v/express-rate-limit.svg)](https://npmjs.org/package/express-rate-limit 'View this project on NPM')\n[![npm downloads](https://img.shields.io/npm/dm/express-rate-limit)](https://www.npmjs.com/package/express-rate-limit)\n[![inspect.software](https://raw.githubusercontent.com/inspect-software/badges/main/v1/e/express-rate-limit/express-rate-limit.svg)](https://inspect.software/software/express-rate-limit/express-rate-limit)\n[![license](https://img.shields.io/npm/l/express-rate-limit)](license.md)\n\n</div>\n\nBasic rate-limiting middleware for [Express](http://expressjs.com/). Use to\nlimit repeated requests to public APIs and/or endpoints such as password reset.\nPlays nice with\n[express-slow-down](https://www.npmjs.com/package/express-slow-down) and\n[ratelimit-header-parser](https://www.npmjs.com/package/ratelimit-header-parser).\n\n## Usage\n\nThe [full documentation](https://express-rate-limit.mintlify.app/overview) is\navailable on-line.\n\n```ts\nimport { rateLimit } from 'express-rate-limit'\n\nconst limiter = rateLimit({\n\twindowMs: 15 * 60 * 1000, // 15 minutes\n\tlimit: 100, // Limit each IP to 100 requests per `window` (here, per 15 minutes).\n\tstandardHeaders: 'draft-8', // draft-6: `RateLimit-*` headers; draft-7 & draft-8: combined `RateLimit` header\n\tlegacyHeaders: false, // Disable the `X-RateLimit-*` headers.\n\tipv6Subnet: 56, // Set to 60 or 64 to be less aggressive, or 52 or 48 to be more aggressive\n\t// store: ... , // Redis, Memcached, etc. See below.\n})\n\n// Apply the rate limiting middleware to all requests.\napp.use(limiter)\n```\n\n### Data Stores\n\nThe rate limiter comes with a built-in memory store, and supports a variety of\n[external data stores](https://express-rate-limit.mintlify.app/reference/stores).\n\n### Configuration\n\nAll function options may be async. Click the name for additional info and\ndefault values.\n\n| Option                     | Type                                      | Remarks                                                                                         |\n| -------------------------- | ----------------------------------------- | ----------------------------------------------------------------------------------------------- |\n| [`windowMs`]               | `number`                                  | How long to remember requests for, in milliseconds.                                             |\n| [`limit`]                  | `number` \\| `function`                    | How many requests to allow.                                                                     |\n| [`message`]                | `string` \\| `json` \\| `function`          | Response to return after limit is reached.                                                      |\n| [`statusCode`]             | `number`                                  | HTTP status code after limit is reached (default is 429).                                       |\n| [`handler`]                | `function`                                | Function to run after limit is reached (overrides `message` and `statusCode` settings, if set). |\n| [`legacyHeaders`]          | `boolean`                                 | Enable the `X-Rate-Limit` header.                                                               |\n| [`standardHeaders`]        | `'draft-6'` \\| `'draft-7'` \\| `'draft-8'` | Enable the `Ratelimit` header.                                                                  |\n| [`identifier`]             | `string` \\| `function`                    | Name associated with the quota policy enforced by this rate limiter.                            |\n| [`store`]                  | `Store`                                   | Use a custom store to share hit counts across multiple nodes.                                   |\n| [`passOnStoreError`]       | `boolean`                                 | Allow (`true`) or block (`false`, default) traffic if the store becomes unavailable.            |\n| [`keyGenerator`]           | `function`                                | Identify users (defaults to IP address).                                                        |\n| [`ipv6Subnet`]             | `number` (32-64) \\| `function` \\| `false` | How many bits of IPv6 addresses to use in default `keyGenerator`                                |\n| [`requestPropertyName`]    | `string`                                  | Add rate limit info to the `req` object.                                                        |\n| [`skip`]                   | `function`                                | Return `true` to bypass the limiter for the given request.                                      |\n| [`skipSuccessfulRequests`] | `boolean`                                 | Uncount 1xx/2xx/3xx responses.                                                                  |\n| [`skipFailedRequests`]     | `boolean`                                 | Uncount 4xx/5xx responses.                                                                      |\n| [`requestWasSuccessful`]   | `function`                                | Used by `skipSuccessfulRequests` and `skipFailedRequests`.                                      |\n| [`validate`]               | `boolean` \\| `object`                     | Enable or disable built-in validation checks.                                                   |\n| [`logger`]                 | `Logger`                                  | Custom logger                                                                                   |\n\n## Thank You\n\n---\n\nThanks to Mintlify for hosting the documentation at\n[express-rate-limit.mintlify.app](https://express-rate-limit.mintlify.app)\n\n<p align=\"center\">\n\t<a href=\"https://mintlify.com/?utm_campaign=devmark&utm_medium=readme&utm_source=express-rate-limit\">\n\t\t<img height=\"75\" src=\"https://devmark-public-assets.s3.us-west-2.amazonaws.com/sponsorships/mintlify.svg\" alt=\"Create your docs today\">\n\t</a>\n</p>\n\n---\n\nAnd thank you to everyone who's contributed to this project in any way! 🫶\n\n## Issues and Contributing\n\nIf you encounter a bug or want to see something added/changed, please go ahead\nand\n[open an issue](https://github.com/express-rate-limit/express-rate-limit/issues/new)!\nIf you need help with something, feel free to\n[start a discussion](https://github.com/express-rate-limit/express-rate-limit/discussions/new)!\n\nIf you wish to contribute to the library, thanks! First, please read\n[the contributing guide](https://express-rate-limit.mintlify.app/guides/contributing).\nThen you can pick up any issue and fix/implement it!\n\n## License\n\nMIT © [Nathan Friedly](http://nfriedly.com/),\n[Vedant K](https://github.com/gamemaker1)\n\n[`windowMs`]:\n\thttps://express-rate-limit.mintlify.app/reference/configuration#windowms\n[`limit`]: https://express-rate-limit.mintlify.app/reference/configuration#limit\n[`message`]:\n\thttps://express-rate-limit.mintlify.app/reference/configuration#message\n[`statusCode`]:\n\thttps://express-rate-limit.mintlify.app/reference/configuration#statuscode\n[`handler`]:\n\thttps://express-rate-limit.mintlify.app/reference/configuration#handler\n[`legacyHeaders`]:\n\thttps://express-rate-limit.mintlify.app/reference/configuration#legacyheaders\n[`standardHeaders`]:\n\thttps://express-rate-limit.mintlify.app/reference/configuration#standardheaders\n[`identifier`]:\n\thttps://express-rate-limit.mintlify.app/reference/configuration#identifier\n[`store`]: https://express-rate-limit.mintlify.app/reference/configuration#store\n[`passOnStoreError`]:\n\thttps://express-rate-limit.mintlify.app/reference/configuration#passonstoreerror\n[`keyGenerator`]:\n\thttps://express-rate-limit.mintlify.app/reference/configuration#keygenerator\n[`ipv6Subnet`]:\n\thttps://express-rate-limit.mintlify.app/reference/configuration#ipv6subnet\n[`requestPropertyName`]:\n\thttps://express-rate-limit.mintlify.app/reference/configuration#requestpropertyname\n[`skip`]: https://express-rate-limit.mintlify.app/reference/configuration#skip\n[`skipSuccessfulRequests`]:\n\thttps://express-rate-limit.mintlify.app/reference/configuration#skipsuccessfulrequests\n[`skipFailedRequests`]:\n\thttps://express-rate-limit.mintlify.app/reference/configuration#skipfailedrequests\n[`requestWasSuccessful`]:\n\thttps://express-rate-limit.mintlify.app/reference/configuration#requestwassuccessful\n[`validate`]:\n\thttps://express-rate-limit.mintlify.app/reference/configuration#validate\n[`logger`]:\n\thttps://express-rate-limit.mintlify.app/reference/configuration#logger\n","publish_time":1785854078370,"_cnpm_publish_time":1785854078370,"dist-tags":{"backport-3.x":"3.5.3","backport-8.0.x":"8.0.2","backport-8.1.x":"8.1.1","backport-8.2.x":"8.2.2","latest":"8.7.3","typescript":"0.0.0-typescript-beta-7","v2backports":"2.14.2"}}