{"id":21492651,"url":"https://github.com/uzo-felix/cache-wizard","last_synced_at":"2026-04-26T08:34:38.656Z","repository":{"id":220318381,"uuid":"751303579","full_name":"Uzo-Felix/cache-wizard","owner":"Uzo-Felix","description":"🚧 Work in Progress 🚧 A middleware library for caching data with various eviction policies, cache invalidation, and cache coherency strategies.","archived":false,"fork":false,"pushed_at":"2024-02-03T08:43:03.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-18T12:53:06.864Z","etag":null,"topics":["cache-coherency","cache-eviction-policy","cache-invalidation","cache-middleware","cache-storage","caching","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/Uzo-Felix.png","metadata":{"files":{"readme":"docs/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}},"created_at":"2024-02-01T10:42:17.000Z","updated_at":"2024-02-01T14:43:53.000Z","dependencies_parsed_at":"2024-02-01T12:47:06.138Z","dependency_job_id":"f77456b1-05db-4b16-8bb2-1dda693ad7c2","html_url":"https://github.com/Uzo-Felix/cache-wizard","commit_stats":null,"previous_names":["uzo-felix/cache-wizard"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Uzo-Felix/cache-wizard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Uzo-Felix%2Fcache-wizard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Uzo-Felix%2Fcache-wizard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Uzo-Felix%2Fcache-wizard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Uzo-Felix%2Fcache-wizard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Uzo-Felix","download_url":"https://codeload.github.com/Uzo-Felix/cache-wizard/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Uzo-Felix%2Fcache-wizard/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32290771,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T08:29:33.829Z","status":"ssl_error","status_checked_at":"2026-04-26T08:29:18.366Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cache-coherency","cache-eviction-policy","cache-invalidation","cache-middleware","cache-storage","caching","nodejs"],"created_at":"2024-11-23T15:30:32.164Z","updated_at":"2026-04-26T08:34:38.637Z","avatar_url":"https://github.com/Uzo-Felix.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Cache-wizard\n\nCache-wizard is a JavaScript library that provides middleware for caching data with various eviction policies, cache invalidation, and cache coherency strategies.\n\n## Installation\n\nYou can install Cache-wizard via npm:\n\n```bash\nnpm install Cache-wizard\n\n## Usage\n\nHere's a basic example of how to use Cache-wizard:\n\n```javascript\nconst { CacheMiddleware } = require('Cache-wizard');\n\n// Create a cache middleware instance\nconst cache = new CacheMiddleware();\n\n// Set key-value pairs in the cache\ncache.set('key1', 'value1');\ncache.set('key2', 'value2');\n\n// Retrieve values from the cache\nconsole.log(cache.get('key1')); // Output: value1\nconsole.log(cache.get('key2')); // Output: value2\n\n// Invalidate a key in the cache\ncache.invalidate('key1');\n\n// Retrieve the invalidated key (should return null)\nconsole.log(cache.get('key1')); // Output: null\n\n// Clear the entire cache\ncache.clear();\n```\n\nFor more advanced usage and configurations, please refer to the [Advanced Usage](../examples/AdvancedUsage.js) example.\n\n## API\n\n### CacheMiddleware Class\n\n#### Constructor\n\n```javascript\nconst cache = new CacheMiddleware(maxSize, hybridOptions);\n```\n\n- `maxSize`: Maximum size of the cache (default is `1000`).\n- `hybridOptions`: Options for hybrid eviction policies (default is an empty object).\n\n#### Methods\n\n- `set(key, value)`: Set a key-value pair in the cache.\n- `get(key)`: Retrieve a value from the cache given its key.\n- `invalidate(key)`: Mark a key as invalid.\n- `remove(key)`: Remove a key from the cache and mark it as invalid.\n- `clear()`: Clear the entire cache.\n- `setCoherencyStrategy(strategy)`: Set the cache coherency strategy.\n\n### Eviction Policies\n\nCache-wizard supports the following eviction policies:\n\n- FIFO (First-In, First-Out)\n- LRU (Least Recently Used)\n- LFU (Least Frequently Used)\n\nFor detailed documentation and usage of eviction policies, please refer to the [Eviction Policies](./docs/EvictionPolicies.md) documentation.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit issues and pull requests.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.\n```\n\nExplanation:\n\n- The README provides an overview of the Cache-wizard library, including installation instructions and basic usage examples.\n- It also includes links to advanced usage examples and documentation for eviction policies.\n- The API section outlines the methods and functionalities provided by the `CacheMiddleware` class.\n- Information about contributing to the project and the license is also included.\n\nThis README template provides users with essential information about the Cache-wizard package and guides them on how to use it effectively.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuzo-felix%2Fcache-wizard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuzo-felix%2Fcache-wizard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuzo-felix%2Fcache-wizard/lists"}