{"id":16368571,"url":"https://github.com/arugaz/elysia-cache","last_synced_at":"2025-10-26T07:30:54.461Z","repository":{"id":194533762,"uuid":"691094272","full_name":"arugaz/elysia-cache","owner":"arugaz","description":"Plugin for Elysia that for LRU Caching","archived":false,"fork":false,"pushed_at":"2023-09-13T17:11:15.000Z","size":18,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-31T16:46:40.646Z","etag":null,"topics":["bun","cache","elysia","lru"],"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/arugaz.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}},"created_at":"2023-09-13T13:42:15.000Z","updated_at":"2024-12-22T20:02:40.000Z","dependencies_parsed_at":"2023-09-13T23:02:48.059Z","dependency_job_id":null,"html_url":"https://github.com/arugaz/elysia-cache","commit_stats":null,"previous_names":["arugaz/elysia-cache"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arugaz%2Felysia-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arugaz%2Felysia-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arugaz%2Felysia-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arugaz%2Felysia-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arugaz","download_url":"https://codeload.github.com/arugaz/elysia-cache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238284767,"owners_count":19446722,"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":["bun","cache","elysia","lru"],"created_at":"2024-10-11T02:53:09.383Z","updated_at":"2025-10-26T07:30:54.158Z","avatar_url":"https://github.com/arugaz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# elysia-cache\nPlugin for [elysia](https://github.com/elysiajs/elysia) that add support for lru cache.\n\n## Installation\n```bash\nbun add elysia-cache\n```\n\n## Example\n```typescript\nimport { Elysia } from 'elysia'\nimport { cache } from 'elysia-cache'\n\nconst app = new Elysia()\n    .use(cache())\n    .get('/set', ({ query, cache }) =\u003e {\n      const key = query.key\n      const value = query.value\n\n      cache.set(key, value)\n\n      return new Response('done')\n    })\n    .get('/get', ({ query, cache }) =\u003e {\n      const key = query.key\n\n      const value = cache.get(key)\n\n      return {\n        value: value\n      }\n    })\n    .get('/flush', ({ cache }) =\u003e cache.clear())\n    .listen(8080)\n```\n\n## Config\nBelow are configurable properties for using LRU cache plugin.\n\n### max\nThe maximum object that can be stored.\n\n## Handler\nBelow are the value added to the handler.\n\n### has\nA function to check cache\n\nType:\n```typescript\nhas(key: string) =\u003e boolean\n```\n\n### remove\nA function to delete cache from given key\n\nType:\n```typescript\nremove(key: string) =\u003e void\n```\n\n### get\nA function to retrieve value in the cache, return null if the value is not in the cache.\n\nType:\n```typescript\nget(key: string | number) =\u003e any\n```\n\n### set\nA function to update cache value from given key\n\nType:\n```typescript\nset(key: string | number, value: any) =\u003e void\n```\n\n### clear\nA function to flush all cache\n\nType:\n```typescript\nclear() =\u003e void\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farugaz%2Felysia-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farugaz%2Felysia-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farugaz%2Felysia-cache/lists"}