{"id":21401328,"url":"https://github.com/capaj/memredis","last_synced_at":"2025-10-10T20:42:20.330Z","repository":{"id":260966200,"uuid":"882844256","full_name":"capaj/memredis","owner":"capaj","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-04T07:39:04.000Z","size":36,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-09T13:08:05.112Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/capaj.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,"zenodo":null}},"created_at":"2024-11-03T22:30:41.000Z","updated_at":"2024-11-08T22:49:14.000Z","dependencies_parsed_at":"2025-04-20T05:16:00.803Z","dependency_job_id":null,"html_url":"https://github.com/capaj/memredis","commit_stats":null,"previous_names":["capaj/memredis"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/capaj/memredis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fmemredis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fmemredis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fmemredis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fmemredis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/capaj","download_url":"https://codeload.github.com/capaj/memredis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fmemredis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005277,"owners_count":26083864,"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-10-10T02:00:06.843Z","response_time":62,"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":[],"created_at":"2024-11-22T15:27:14.414Z","updated_at":"2025-10-10T20:42:20.307Z","avatar_url":"https://github.com/capaj.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @capaj/memredis \n\n🚀 Redis-backed memoization for your async functions\n\n## Features\n\n🔄 Cache async function results in Redis  \n⚡ Fast lookups using customizable cache keys  \n⏰ Configurable TTL (Time To Live)  \n🔍 Debug logging support  \n🧹 Easy cache clearing - both complete and per-key  \n🔌 Works with ioredis client  \n\n## Installation\n\n```bash\npnpm install @capaj/memredis\n```\n\n# Usage\nFirst, create your memRedis instance with your Redis client:\n\n```typescript\nimport { createMemRedis } from '@capaj/memredis'\nimport { Redis } from 'ioredis' // or any other Redis client\n\nconst redis = new Redis()\nconst memRedis = createMemRedis(redis)\n\nconst memoizedGetUser = memRedis(\n  async (userId: string) =\u003e {\n    // your expensive operation here\n    return await db.getUserData(userId)\n  },\n  {\n    maxAge: 3600, // cache for 1 hour\n    cachePrefix: 'user-data'\n  }\n)\n\n// Use the memoized function- this will cache the result in Redis\nconst userData = await memoizedGetUser.memoized('user123')\n\nconst userDataFromRedis = await memoizedGetUser.memoized('user123') // this will return the cached result\n\n// Clear specific cache entry\nawait memoizedGetUser.clearKey('user123')\n\n// Clear all cache entries for this function\nawait memoizedGetUser.clear()\n```\n\n## License \n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapaj%2Fmemredis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapaj%2Fmemredis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapaj%2Fmemredis/lists"}