File-Sys-Cache

File-Sys-Cache is an npm package that provides a simple and efficient system files-based caching solution for Node.js applications.

  • Set Cache
  • Get Cached Data
  • Invalidate Cached Data
  • Flush Cache by Regex
  • Flush Whole Cache
  • Monitoring
  • TypeScript Support
Bash
$npm i file-sys-cache
Click to copy

What's included

Set Cache

Store data in the cache with options to specify file name prefix, file name, payload, and time-to-live (TTL).

Get Cached Data

Retrieve cached data by providing the corresponding file name or prefix.

Invalidate Cached Data

Automatically invalidate cached data for items with expired TTLs.

Flush Cache by Regex

Flush cache entries that match a given regular expression.

Flush Whole Cache

Clear the entire cache, removing all stored entries.

Monitoring

Monitor cache usage and performance statistics, including invalidated files count, logs over time, size over time, and request count.