{"id":13447192,"url":"https://github.com/express-rate-limit/express-rate-limit","last_synced_at":"2025-05-13T15:03:58.597Z","repository":{"id":24447050,"uuid":"27849281","full_name":"express-rate-limit/express-rate-limit","owner":"express-rate-limit","description":"Basic rate-limiting middleware for the Express web server","archived":false,"fork":false,"pushed_at":"2025-04-30T00:12:22.000Z","size":3627,"stargazers_count":3058,"open_issues_count":6,"forks_count":231,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-05-12T23:36:50.717Z","etag":null,"topics":["api","express","express-js","express-middleware","nodejs","rate-limiter","rate-limiting","rest-api","security","web"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/express-rate-limit","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/express-rate-limit.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["express-rate-limit"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2014-12-11T01:56:32.000Z","updated_at":"2025-05-12T03:26:27.000Z","dependencies_parsed_at":"2023-10-01T17:24:59.449Z","dependency_job_id":"d26faf9e-b047-479b-adc1-696e72bcbf19","html_url":"https://github.com/express-rate-limit/express-rate-limit","commit_stats":{"total_commits":684,"total_committers":67,"mean_commits":"10.208955223880597","dds":0.543859649122807,"last_synced_commit":"413995b8013b1679e005d6ebebd1104afcd614b8"},"previous_names":["nfriedly/express-rate-limit"],"tags_count":112,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/express-rate-limit%2Fexpress-rate-limit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/express-rate-limit%2Fexpress-rate-limit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/express-rate-limit%2Fexpress-rate-limit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/express-rate-limit%2Fexpress-rate-limit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/express-rate-limit","download_url":"https://codeload.github.com/express-rate-limit/express-rate-limit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253968559,"owners_count":21992255,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","express","express-js","express-middleware","nodejs","rate-limiter","rate-limiting","rest-api","security","web"],"created_at":"2024-07-31T05:01:10.574Z","updated_at":"2025-05-13T15:03:58.545Z","avatar_url":"https://github.com/express-rate-limit.png","language":"TypeScript","funding_links":["https://github.com/sponsors/express-rate-limit"],"categories":["JavaScript","TypeScript"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e \u003ccode\u003eexpress-rate-limit\u003c/code\u003e \u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\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\u003c/div\u003e\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 \u0026 draft-8: 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'` \\| `'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| [`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\u003cp align=\"center\"\u003e\n\u003ca href=\"https://zuplo.link/express-rate-limit\"\u003e\n\u003cpicture width=\"322\"\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/express-rate-limit/express-rate-limit/assets/114976/cd2f6fa7-eae1-4fbb-be7d-b17df4c6f383\"\u003e\n  \u003cimg alt=\"zuplo-logo\" src=\"https://github.com/express-rate-limit/express-rate-limit/assets/114976/66fd75fa-b39e-4a8c-8d7a-52369bf244dc\" width=\"322\"\u003e\n\u003c/picture\u003e\n\u003c/a\u003e\n\u003c/p\u003e\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\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://mintlify.com/?utm_campaign=devmark\u0026utm_medium=readme\u0026utm_source=express-rate-limit\"\u003e\n\t\t\u003cimg height=\"75\" src=\"https://devmark-public-assets.s3.us-west-2.amazonaws.com/sponsorships/mintlify.svg\" alt=\"Create your docs today\"\u003e\n\t\u003c/a\u003e\n\u003c/p\u003e\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[`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[`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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexpress-rate-limit%2Fexpress-rate-limit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexpress-rate-limit%2Fexpress-rate-limit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexpress-rate-limit%2Fexpress-rate-limit/lists"}