{"id":29103160,"url":"https://github.com/tearlighting/cachecraft","last_synced_at":"2025-10-13T07:02:33.532Z","repository":{"id":301533927,"uuid":"1009551591","full_name":"tearlighting/CacheCraft","owner":"tearlighting","description":"A lightweight TypeScript core utilities library for pagination, caching and pluggable extensions.","archived":false,"fork":false,"pushed_at":"2025-06-27T10:18:54.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-27T11:31:39.208Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tearlighting.png","metadata":{"files":{"readme":"readme.en.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}},"created_at":"2025-06-27T10:10:32.000Z","updated_at":"2025-06-27T10:18:57.000Z","dependencies_parsed_at":"2025-06-27T11:34:20.399Z","dependency_job_id":"f720a36b-f772-4307-8aa5-fae4decd1de1","html_url":"https://github.com/tearlighting/CacheCraft","commit_stats":null,"previous_names":["tearlighting/cachecraft"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tearlighting/CacheCraft","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tearlighting%2FCacheCraft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tearlighting%2FCacheCraft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tearlighting%2FCacheCraft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tearlighting%2FCacheCraft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tearlighting","download_url":"https://codeload.github.com/tearlighting/CacheCraft/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tearlighting%2FCacheCraft/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014006,"owners_count":26085435,"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-13T02:00:06.723Z","response_time":61,"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":"2025-06-28T23:08:21.569Z","updated_at":"2025-10-13T07:02:33.500Z","avatar_url":"https://github.com/tearlighting.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CacheCraft\n\nA lightweight, composable core utilities library that includes a pagination pool (`PaginationPool`), cache pool, and plugin system.\nDesigned to keep framework-independent logic reusable across Vue / React / Node projects.\n\n---\n\n## 🚀 Minimal Usage\n\n```ts\nimport { AmplifyDataReader, PaginationPool, MemoryCache } from \"cachecraft\"\n\n// Create a data reader (or implement your own IReadDB)\nconst dataReader = new AmplifyDataReader(({ limit, nextToken }) =\u003e {\n  // Call your Amplify API here\n  return {\n    items: [],\n    nextToken: null,\n  }\n})\n\n// Create the pagination pool\nconst paginationPool = new PaginationPool(dataReader, 100, (x) =\u003e x.id)\n\n// Create a cache (optional)\nconst cache = new MemoryCache()\n\nconst enum EPaginationCacheKey {\n  Pagination = \"pagination\",\n}\n\n// Inject the cache manually (optional)\npaginationPool.resetCacheData(cache[EPaginationCacheKey.Pagination])\n\n// Fetch page 1\npaginationPool.getPageData(1).then(console.log)\n```\n\n---\n\n## 🔌 Plugin Example\n\n```ts\nimport { AmplifyDataReader, PaginationPool, withPlugins, MemoryCache, SyncMemoryWithPaginationPoolCache } from \"cachecraft\"\n\n// Create a data reader\nconst dataReader = new AmplifyDataReader(({ limit, nextToken }) =\u003e {\n  return {\n    items: [],\n    nextToken: null,\n  }\n})\n\n// Wrap PaginationPool with plugin support\nconst PaginationPoolWithPlugins = withPlugins(PaginationPool)\n\nconst paginationPool = new PaginationPoolWithPlugins(dataReader, 100, (x) =\u003e x.id)\n\n// Create a cache\nconst cache = new MemoryCache()\nconst enum EPaginationCacheKey {\n  Pagination = \"pagination\",\n}\n\n// Mount the plugin (chainable)\npaginationPool\n  .usePlugin(new SyncMemoryWithPaginationPoolCache(EPaginationCacheKey.Pagination, cache))\n  // Chain other plugins if needed\n  .getPageData(1)\n  .then(console.log)\n```\n\n---\n\n## 📌 How to extend\n\n- Implement your own `IReadDB` for any backend\n- Create your own `CacheBase` (Redis, localStorage, etc.)\n- Write custom plugins (logging, auto-refresh, tracking, etc.)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftearlighting%2Fcachecraft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftearlighting%2Fcachecraft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftearlighting%2Fcachecraft/lists"}