{"id":32840609,"url":"https://github.com/muradisazade777/ts-rate-limiter","last_synced_at":"2025-11-13T07:01:58.368Z","repository":{"id":322848854,"uuid":"1091138350","full_name":"MuradIsazade777/TS-Rate-Limiter","owner":"MuradIsazade777","description":"A modular, scalable, and production-ready API rate limiter built with TypeScript and Redis. Designed for Express and Fastify, this package provides plug-and-play middleware, CLI tools, and branded configuration for managing request limits across endpoints and IPs.","archived":false,"fork":false,"pushed_at":"2025-11-06T16:24:52.000Z","size":14549,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-06T18:16:56.600Z","etag":null,"topics":["api","backend","backend-api","config","configuration","javascript","js","json","redis","testing","token","ts","typescript"],"latest_commit_sha":null,"homepage":"","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/MuradIsazade777.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-06T15:55:29.000Z","updated_at":"2025-11-06T16:35:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/MuradIsazade777/TS-Rate-Limiter","commit_stats":null,"previous_names":["muradisazade777/ts-rate-limiter"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/MuradIsazade777/TS-Rate-Limiter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MuradIsazade777%2FTS-Rate-Limiter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MuradIsazade777%2FTS-Rate-Limiter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MuradIsazade777%2FTS-Rate-Limiter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MuradIsazade777%2FTS-Rate-Limiter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MuradIsazade777","download_url":"https://codeload.github.com/MuradIsazade777/TS-Rate-Limiter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MuradIsazade777%2FTS-Rate-Limiter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283618956,"owners_count":26865775,"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","status":"online","status_checked_at":"2025-11-10T02:00:06.292Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","backend","backend-api","config","configuration","javascript","js","json","redis","testing","token","ts","typescript"],"created_at":"2025-11-08T02:00:33.156Z","updated_at":"2025-11-12T06:01:25.480Z","avatar_url":"https://github.com/MuradIsazade777.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚦 TS Rate Limiter\n\nA modular, scalable, and production-ready API rate limiter built with TypeScript and Redis. Designed for Express and Fastify, this package provides plug-and-play middleware, CLI tools, and branded configuration for managing request limits across endpoints and IPs.\n\n---\n\n## ✨ Features\n\n- 🔧 Token Bucket / Sliding Window algorithm\n- 🧠 Redis-based usage tracking\n- 🧩 Express \u0026 Fastify middleware support\n- 🛠️ CLI tools for stats and reset\n- 📦 Modular architecture with clean separation of concerns\n- 📊 Configurable via JSON or YAML\n- 🧪 Fully tested with Jest\n\n---\n\n## 📦 Installation\n\n```bash\nnpm install ts-rate-limiter\n```\n\n## 🚀 Usage\n\n### Express Integration\n\n```ts\nimport express from 'express';\nimport { expressLimiter } from 'ts-rate-limiter';\nimport { RateLimiter, RedisAdapter, loadConfig } from 'ts-rate-limiter';\n\nconst app = express();\nconst config = loadConfig();\nconst adapter = new RedisAdapter(process.env.REDIS_URL || 'redis://localhost:6379');\nconst limiter = new RateLimiter(config, adapter);\n\napp.use(expressLimiter(limiter));\napp.get('/api', (req, res) =\u003e res\n```\n\nCLI Commands\n```bash\n# Show usage stats\nnpm run cli stats 127.0.0.1:/api\n\n# Reset usage for a key\nnpm run cli reset 127.0.0.1:/api\n```\n🧪 Testing\n```bash\nnpm test\n```\n\nEach folder is modular and purpose-driven:\n\n- **core/** – Implements the rate limiting logic and exposes the public API.\n- **adapters/** – Contains pluggable storage backends (e.g., Redis, in-memory).\n- **middleware/** – Provides ready-to-use integrations for Express and Fastify.\n- **config/** – Loads default configurations and limit presets.\n- **cli/** – CLI interface with commands and branding banner.\n- **utils/** – Shared utilities like logging and time calculations.\n- **tests/** – Comprehensive Jest test coverage for all modules.\n\n📜 License\nThis project is licensed under the MIT License. See the LICENSE file for details.\n\n💡 Author\nMurad — Backend Architect \u0026 Full Stack Developer Crafted with precision, modularity, and branded elegance ✨\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuradisazade777%2Fts-rate-limiter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuradisazade777%2Fts-rate-limiter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuradisazade777%2Fts-rate-limiter/lists"}