A super-fast, promise-based cache that reads and writes to the file-system.
npm install --save file-system-cache
Create an instance of the cache optionally giving it a folder location to store files within.
;const cache =;
ns ("namespace") allows for multiple groupings of files to reside within the one cache folder. When you have multiple caches with different namespaces you can re-use the same keys and they will not collide.
Retrieves the contents of a cached file.
getSync for a synchronous version. Pass a
defaultValue parameter to have that value returned if nothing exists within the cache.
Write a value to the cache.
Value types are stored and respected on subsequent calls to
get. For examples, passing in Object will return that in it's parsed object state.
setSync for a synchronous version.
Deletes the specified cache item from the file-system.
Clears all cached items from the file-system.
Saves (sets) several items to the cache in one operation.
Loads all files within the cache's namespace.
# Run tests. npm test # Watch and re-run tests. npm run tdd