Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/justin-m-lacy/archcache
https://github.com/justin-m-lacy/archcache
cache caching files javascript node
Last synced: 26 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/justin-m-lacy/archcache
- Owner: justin-m-lacy
- Created: 2019-03-19T00:42:06.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-08-06T20:35:52.000Z (over 1 year ago)
- Last Synced: 2024-09-13T23:48:06.366Z (about 2 months ago)
- Topics: cache, caching, files, javascript, node
- Language: TypeScript
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Archcache
Simple In-Memory Cache with callbacks to save, load, and revive from a background store.
Caches can store subcaches to retrieve items in a hierarchical manner.
```
const cache = new Cache({/// Base key prepended to items added to this cache.
/// cacheKeys of subcaches are concatenated and prefixed to an item's key.
cacheKey: '',
loader( cacheKey:string ){
/// Load item by key from backing store.
},
reviver( data:string ){
/// Revive data loaded from backing store.
},
saver( cacheKey:string, data:any ){
/// ... save data stored at key.
},
checker( cacheKey:string ){
/// Determine if keyed object exists in backing store.
},
deleter( cacheKey:string ){
/// Delete item from backing store
}});
```