{"id":19442109,"url":"https://github.com/ackeecz/kesha","last_synced_at":"2026-01-05T04:51:23.935Z","repository":{"id":38249642,"uuid":"500928515","full_name":"AckeeCZ/kesha","owner":"AckeeCZ","description":"Caching utils based on ioredis and dataloaders","archived":false,"fork":false,"pushed_at":"2024-07-17T08:13:08.000Z","size":64,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T18:17:55.792Z","etag":null,"topics":["backend"],"latest_commit_sha":null,"homepage":"","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/AckeeCZ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-06-07T16:53:00.000Z","updated_at":"2024-10-23T07:12:34.000Z","dependencies_parsed_at":"2024-07-17T02:04:18.093Z","dependency_job_id":null,"html_url":"https://github.com/AckeeCZ/kesha","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AckeeCZ%2Fkesha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AckeeCZ%2Fkesha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AckeeCZ%2Fkesha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AckeeCZ%2Fkesha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AckeeCZ","download_url":"https://codeload.github.com/AckeeCZ/kesha/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244985497,"owners_count":20542831,"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":["backend"],"created_at":"2024-11-10T15:38:16.381Z","updated_at":"2026-01-05T04:51:23.910Z","avatar_url":"https://github.com/AckeeCZ.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n![](logo.png)\n\n# Kesha\n\nCaching utils based on [ioredis](https://www.npmjs.com/package/ioredis)\nand [dataloaders](https://github.com/graphql/dataloader)\n\u003c/div\u003e\n\n## Quick start 🚀\n\n- Initialize [ioredis](https://www.npmjs.com/package/ioredis) client\n\n```typescript\nimport Redis from 'ioredis';\n\nconst redisClient = new Redis({\n  // Host, DB,...\n})\n```\n\n- Use exported utils directly f.e. [rateLimiter](src/lib/rateLimiter.ts)\n\n```typescript\nimport { rateLimiter } from 'kesha';\n\nconst rateLimitedFn = rateLimiter(redisClient, (number: number) =\u003e {\n  console.log('Called')\n}, '', 1000)\n```\n\n- or create set of utils for client with [createRedisRepository](src/lib/redisRepository.ts)\n\n```typescript\nimport { createRedisRepository } from 'kesha';\n\nconst repo = createRedisRepository(client)\n\nconst rateLimitedFn = repo.rateLimiter((number: number) =\u003e {\n  console.log('Called')\n}, '', 1000)\n```\n\n- Provide typehints for `setJSON` and `getJSON` methods\n\n```typescript\n// Per key\nconst repoPerKey = createRedisRepository\u003c{ 'test:key': string }\u003e(client)\n\nrepoPerKey.setJSON('test:key', {}) // TS Error: {} is not assignable to string\n\n// Using template litarals to define key prefixes (From TS 4.4+)\nconst repo = createRedisRepository\u003c{ [K: `test:key:${number}`]: string }\u003e(client)\n\nrepo.setJSON('test:key:1', {}) // TS Error: {} is not assignable to string\nrepo.getJSON('test:key:1') // TS: Returns string\nrepo.getJSON('test:key:a') // TS: Returns any\n\n```\n\n## Tests 🧪\n\n- Prepare docker container with Redis 🐳\n\n```bash\nsudo docker-compose -f docker-compose/docker-compose.yml up\n```\n\n- Run the tests\n\n```bash\nnpm run test\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fackeecz%2Fkesha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fackeecz%2Fkesha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fackeecz%2Fkesha/lists"}