{"id":25741001,"url":"https://github.com/moeedhy/nestjs-rate-limiter","last_synced_at":"2026-05-15T10:37:20.221Z","repository":{"id":190383382,"uuid":"682502496","full_name":"moeedhy/nestjs-rate-limiter","owner":"moeedhy","description":"A Nest.js module for rate limiting using express-rate-limit","archived":false,"fork":false,"pushed_at":"2023-08-24T10:24:37.000Z","size":84,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-14T15:47:42.379Z","etag":null,"topics":["nest","nestjs","nestjs-backend","nestjs-module","nestjs-rate-limiter","rate-limiter"],"latest_commit_sha":null,"homepage":"https://moeed.net","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moeedhy.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}},"created_at":"2023-08-24T10:05:14.000Z","updated_at":"2023-10-12T16:06:16.000Z","dependencies_parsed_at":"2023-08-24T12:13:51.501Z","dependency_job_id":null,"html_url":"https://github.com/moeedhy/nestjs-rate-limiter","commit_stats":null,"previous_names":["moeedhy/nestjs-rate-limiter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moeedhy%2Fnestjs-rate-limiter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moeedhy%2Fnestjs-rate-limiter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moeedhy%2Fnestjs-rate-limiter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moeedhy%2Fnestjs-rate-limiter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moeedhy","download_url":"https://codeload.github.com/moeedhy/nestjs-rate-limiter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240643994,"owners_count":19834343,"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":["nest","nestjs","nestjs-backend","nestjs-module","nestjs-rate-limiter","rate-limiter"],"created_at":"2025-02-26T09:19:13.358Z","updated_at":"2026-05-15T10:37:20.191Z","avatar_url":"https://github.com/moeedhy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Nest.js Rate Limiter Module\n\nA simple and efficient rate limiting module for Nest.js applications. It leverages `express-rate-limit` to protect your application from abuse by limiting the number of requests that a client can make within a defined time window.\n\n## Installation\n\nFirst, install the module using npm:\n\n```bash\nnpm install @moeed/nestjs-rate-limiter --save\n```\n\nMake sure to also have `express-rate-limit` installed, as it is a peer dependency.\n\n## Usage\n\nImport the `RateLimiterModule` into your root module and configure it using the `register` method:\n\n```typescript\nimport { RateLimitModule } from '@moeed/nestjs-rate-limiter';\n\n@Module({\n  imports: [\n    RateLimiterModule.register({\n      windowMs: 15 * 60 * 1000, // 15 minutes\n      max: 100, // limit each IP to 100 requests per windowMs\n    }),\n    // ... other modules\n  ],\n})\nexport class AppModule {}\n```\n\n### Custom Routes\n\nYou can specify custom routes to apply rate limiting by using the `routes` option:\n\n```typescript\nRateLimiterModule.register({\n  windowMs: 15 * 60 * 1000,\n  max: 100,\n  routes: [\n    { path: '/api', method: RequestMethod.ALL },\n    { path: '/auth/login', method: RequestMethod.POST },\n  ],\n})\n```\n\n## Options\n\nThe following options can be used to configure the rate-limiting behavior:\n\n- `windowMs`: The duration in milliseconds to keep track of requests (default: `60000`).\n- `max`: The maximum number of requests allowed within `windowMs` (default: `5`).\n- `routes`: An optional array of custom routes to apply rate limiting.\n\nSee the [`express-rate-limit` documentation](https://www.npmjs.com/package/express-rate-limit) for more options and details.\n\n## Features\n\n- Easy integration with existing Nest.js applications.\n- Extends `express-rate-limit`, allowing for a wide range of customization.\n- Global module availability.\n\n## Contributing\n\nContributions, issues, and feature requests are welcome! Feel free to check [issues page](https://github.com/moeedhy/nestjs-rate-limiter/issues) or open a pull request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE.md) file for details.\n\n## Support\n\nIf you find this package useful, please consider starring the repository on GitHub or sharing it with your colleagues.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoeedhy%2Fnestjs-rate-limiter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoeedhy%2Fnestjs-rate-limiter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoeedhy%2Fnestjs-rate-limiter/lists"}