{"id":22488968,"url":"https://github.com/ndragun92/file-sys-cache","last_synced_at":"2025-08-02T21:31:58.800Z","repository":{"id":226649899,"uuid":"769273789","full_name":"ndragun92/file-sys-cache","owner":"ndragun92","description":"Efficient system files-based caching for Node.js applications.","archived":false,"fork":false,"pushed_at":"2024-03-14T16:25:27.000Z","size":1913,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-03-15T14:12:39.251Z","etag":null,"topics":["cache","caching","file-cache","filesystem","node","npm","optimization","package","performance","storage","system"],"latest_commit_sha":null,"homepage":"https://ndragun92.github.io/file-sys-cache/","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/ndragun92.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-08T17:46:06.000Z","updated_at":"2024-03-14T19:51:18.000Z","dependencies_parsed_at":"2024-03-11T14:05:52.293Z","dependency_job_id":null,"html_url":"https://github.com/ndragun92/file-sys-cache","commit_stats":null,"previous_names":["ndragun92/file-sys-cache"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndragun92%2Ffile-sys-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndragun92%2Ffile-sys-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndragun92%2Ffile-sys-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndragun92%2Ffile-sys-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ndragun92","download_url":"https://codeload.github.com/ndragun92/file-sys-cache/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228500221,"owners_count":17930020,"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":["cache","caching","file-cache","filesystem","node","npm","optimization","package","performance","storage","system"],"created_at":"2024-12-06T17:18:59.822Z","updated_at":"2024-12-06T17:21:08.511Z","avatar_url":"https://github.com/ndragun92.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# File-Sys-Cache\n\nFile-Sys-Cache is an npm package that provides a simple and efficient system files-based caching solution for Node.js applications.\n\n## Features\n\n- **Set Cache**: Store data in the cache with options to specify file name prefix, file name, payload, and time-to-live (TTL).\n- **Get Cached Data**: Retrieve cached data by providing the corresponding file name or prefix.\n- **Invalidate Cached Data**: Automatically invalidate cached data for items with expired TTLs.\n- **Flush Cache by Regex**: Flush cache entries that match a given regular expression.\n- **Flush Whole Cache**: Clear the entire cache, removing all stored entries.\n- **Monitoring**: Monitor cache usage and performance statistics, including invalidated files count, logs over time, size over time, and request count.\n- **TypeScript**: Full TypeScript support\n\n## Installation\n\nInstall File-Sys-Cache via npm:\n\n```bash\nnpm install file-sys-cache\n```\n\n## Usage\n```javascript\nimport { FileSysCache } from 'file-sys-cache'\n\n// Create a new cache instance\nconst cache = new FileSysCache({\n    basePath: './.file-sys-cache', // Directory where cache will be stored\n    defaultTTL: 60, // 60 seconds expiration time\n    hash: 'sha256', // Hashing algorithm\n    debug: false, // Enabled debug mode\n    autoInvalidate: false, // Auto invalidate files from file-system and delete expired files automatically without need of triggering .invalidate()\n    enableMonitoring: false // Enabled monitoring which exposes cache.monitoring.get(), cache.monitoring.reset()\n});\n\n// Set cache with a file name prefix, file name, payload, and TTL\nawait cache.set({ fileName: 'myFileName', key: 'myUniqueKey', payload: myPayload, ttl: 3600 })\n\n// Retrieve cached data by file name prefix and file name\nconst data = await cache.get({ fileName: 'myFileName', key: 'myUniqueKey' });\n\n// Retrieve current list of files inside cache\nconst data = await cache.files();\n\n// Flush cache by passing regex\nawait cache.flushByRegex('myString', 'myString2'); // Flush cache by regex match (single or multiple same matches)\n\n// Flush whole cache\nawait cache.flushAll();\n```\n\nFor more detailed usage examples and API documentation, please refer to the [Documentation](https://ndragun92.github.io/file-sys-cache) section.\n\n## Contributing\nContributions are welcome! Please see the [Contributing Guidelines](https://github.com/ndragun92/file-sys-cache/blob/main/CONTRIBUTING.md) for more information.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/ndragun92/file-sys-cache/blob/main/LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fndragun92%2Ffile-sys-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fndragun92%2Ffile-sys-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fndragun92%2Ffile-sys-cache/lists"}