1.0.5 • Published 6 years ago
sru v1.0.5
sru
A dead simple, high performance, somewhat-recently-used cache.
O(1) insertion, retrieval and deletion.
Examples
function cubed (x) {
return x * x * x
}
let sru = require('sru')
let cache = sru(100)
console.log(cache(8, cubed), 512)
console.log(cache(8, cubed), 512) // cubed was not called this time