{"name":"express-rate-limit","version":"6.7.0","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@6.7.0","homepage":"https://github.com/express-rate-limit/express-rate-limit","bugs":{"url":"https://github.com/express-rate-limit/express-rate-limit/issues"},"xo":{"rules":{"n/no-unsupported-features/es-syntax":0,"@typescript-eslint/no-dynamic-delete":0,"@typescript-eslint/no-empty-function":0,"@typescript-eslint/no-confusing-void-expression":0,"@typescript-eslint/consistent-indexed-object-style":["error","index-signature"]},"prettier":true},"dist":{"shasum":"6aa8a1bd63dfe79702267b3af1161a93afc1d3c2","tarball":"http://registry-npm.ywwl.com/express-rate-limit/download/express-rate-limit-6.7.0.tgz","fileCount":8,"integrity":"sha512-vhwIdRoqcYB/72TK3tRZI+0ttS8Ytrk24GfmsxDXK9o9IhHNO5bXRiXQSExPQ4GbaE5tvIS7j1SGrxsuWs+sGA==","signatures":[{"sig":"MEQCIHRaFV3PmjbtvNdQbhqz+NtE7RMMbR2zbD+DXHetyuzKAiAmfNeDUJdsLHJIuBezcrBQEYgQKMaqjZ8G31AlzPLEvw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":56800,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjc+HpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpldw/8CmX//CL5vD+vLEz2qGjD7pYx9IJ2z/5DPmlm7jTetOYYxo6g\r\nIKpTbP9raoUYI3DqkWM03j+iXm5rK9eQBbf62Q+b/14krN7+bRbPf0il/uw8\r\nPI0Jfozl5Pj50Rto6xpSPYA5wZ1A4MQOYRcyoBJFUMGGK8zsctkzGn9zVLFa\r\n7w5A90j6bzrD+ygShc7npS+whzoUM+v4xLCLnW+VlmiDABoZvmu846oLn6uV\r\nDa04Z/iqqwZ8+YUYPcQugPQSls+cyC1ioLylae4eG9zgP1uKzZf97eGOhmYB\r\nfWpiHHjwrKEw8o7p5qhsB71IiU1kw9ImLjPR44cHMS948c7Rs1oTYKtzQLIC\r\nH0tIdv0UF3sKx27HBoveWXwl3CNSyK3H8C3Dm/S8z7bzAl+LBSBBs9Z6HASm\r\n1Q7Imk91zElCR39GLuxFYI3gKFUEdH2EYeqmrgqa3uHBqk0ptz1Z6gneFw7L\r\nzuLAaja8FqElcV363N+JOkxRZNX6pBFStjY2YRwb9MP2OueC9SY52TtdrYaR\r\nKqhEIX6qz/KO+uIA64Cd/wCQnMfO2hFOE1KviJFiiBAVVx/EkUQPjC21og89\r\nS/B76uYdMb98vSE16aVYzEI8c10F7fo4haO2IxHVdBC4VzLTgkI6+FFz22Wr\r\nNsEhpu3I+tWCH8uf4S5Tw2F4XTgsUzOyNek=\r\n=gXMK\r\n-----END PGP SIGNATURE-----\r\n","size":15700,"noattachment":false,"key":"/express-rate-limit/-/express-rate-limit-6.7.0.tgz"},"jest":{"preset":"ts-jest/presets/default-esm","globals":{"ts-jest":{"useESM":true}},"verbose":true,"testMatch":["**/test/library/**/*-test.[jt]s?(x)"],"testTimeout":30000,"collectCoverage":true,"moduleNameMapper":{"^(\\.{1,2}/.*)\\.js$":"$1"},"collectCoverageFrom":["source/**/*.ts"],"moduleFileExtensions":["js","jsx","json","ts","tsx"]},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">= 12.9.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"8fdcbf01843e54dbcf971439623fb314b7391ccc","scripts":{"lint":"run-s lint:*","test":"run-s lint test:*","clean":"del-cli dist/ coverage/ *.log *.tmp *.bak *.tgz","autofix":"run-s autofix:*","compile":"run-s clean build:*","prepare":"run-s compile && husky install config/husky","test:ext":"cd test/external/ && bash run-all-tests","test:lib":"cross-env NODE_OPTIONS=--experimental-vm-modules jest","build:cjs":"esbuild --bundle --target=es2019 --format=cjs --outfile=dist/index.cjs --footer:js=\"module.exports = rateLimit; module.exports.default = rateLimit; module.exports.rateLimit = rateLimit; module.exports.MemoryStore = MemoryStore;\" source/index.ts","build:esm":"esbuild --bundle --target=es2019 --format=esm --outfile=dist/index.mjs source/index.ts","lint:code":"xo --ignore test/external/","lint:rest":"prettier --ignore-path .gitignore --ignore-unknown --check .","pre-commit":"lint-staged","build:types":"dts-bundle-generator --out-file=dist/index.d.ts source/index.ts","autofix:code":"xo --ignore test/external/ --fix","autofix:rest":"prettier --ignore-path .gitignore --ignore-unknown --write ."},"_npmUser":{"name":"nfriedly","email":"nathan@nfriedly.com"},"prettier":{"semi":false,"useTabs":true,"proseWrap":"always","singleQuote":true,"trailingComma":"all","bracketSpacing":true},"repository":{"url":"git+https://github.com/express-rate-limit/express-rate-limit.git","type":"git"},"_npmVersion":"8.19.2","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":{"**/*.{json,yaml,md}":"prettier --ignore-path .gitignore --ignore-unknown --write ","{source,test}/**/*.ts":"xo --ignore test/external/ --fix"},"_nodeVersion":"18.12.0","_hasShrinkwrap":false,"devDependencies":{"xo":"0.49.0","jest":"29.3.1","husky":"8.0.2","del-cli":"5.0.0","esbuild":"0.15.14","express":"4.18.2","ts-jest":"29.0.3","ts-node":"10.9.1","cross-env":"7.0.3","supertest":"6.3.1","typescript":"4.8.4","@types/jest":"29.2.3","@types/node":"18.11.9","lint-staged":"13.0.3","npm-run-all":"4.1.5","@jest/globals":"29.3.1","@types/express":"4.17.14","@types/supertest":"2.0.12","dts-bundle-generator":"7.0.0"},"peerDependencies":{"express":"^4 || ^5"},"_npmOperationalInternal":{"tmp":"tmp/express-rate-limit_6.7.0_1668538857182_0.7073476153755591","host":"s3://npm-registry-packages"},"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[![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-7', // draft-6: `RateLimit-*` headers; draft-7: combined `RateLimit` header\n\tlegacyHeaders: false, // Disable the `X-RateLimit-*` headers.\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'`       | Enable the `Ratelimit` header.                                                                  |\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| [`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\n## Thank You\n\nSponsored by [Zuplo](https://zuplo.link/express-rate-limit) a fully-managed API\nGateway for developers. Add\n[dynamic rate-limiting](https://zuplo.link/dynamic-rate-limiting),\nauthentication and more to any API in minutes. Learn more at\n[zuplo.com](https://zuplo.link/express-rate-limit)\n\n<p align=\"center\">\n<a href=\"https://zuplo.link/express-rate-limit\">\n<picture width=\"322\">\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/express-rate-limit/express-rate-limit/assets/114976/cd2f6fa7-eae1-4fbb-be7d-b17df4c6f383\">\n  <img alt=\"zuplo-logo\" src=\"https://github.com/express-rate-limit/express-rate-limit/assets/114976/66fd75fa-b39e-4a8c-8d7a-52369bf244dc\" width=\"322\">\n</picture>\n</a>\n</p>\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\nFinally, 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/docs/guides/contributing.mdx).\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[`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[`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","publish_time":1668538857416,"maintainers":[{"name":"nfriedly","email":"nathan@nfriedly.com"},{"name":"gamemaker1","email":"gamemaker0042@gmail.com"}],"_cnpm_publish_time":1668538857416,"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"}}