0.11.0-alpha • Published 3 years ago
cache-eight v0.11.0-alpha
cache-eight
cache + v8
checksum keys
access data from json files (cache)
optimize functions execution time for expensive operations
data is saved using v8's serialize / deserialize
why?
caching expensive pure functions results
same inputs -> same results
const values = [1, 2, 3];
const key = values.toString();
const cached = deserialize(key);
// if has cached value, return early (skipping further functions)
if (cached) return cached;
//else get it from somewhere
const result = values.map(value => value * 2);
//cache the result
await serialize(key, result);
return result;
import Cache from 'cache-eight';
const cache = new Cache();
//
0.5.0-alpha
3 years ago
0.6.0-alpha
3 years ago
0.11.0-alpha
3 years ago
0.7.0-alpha
3 years ago
0.10.0-alpha
3 years ago
0.8.0-alpha
3 years ago
0.9.0-alpha
3 years ago
0.4.0-alpha
3 years ago
0.3.0-alpha
3 years ago
0.2.0-alpha
3 years ago
0.1.0-alpha
3 years ago