sru
v1.0.5
Published
A dead simple, high performance, somewhat-recently-used cache.
Downloads
5
Maintainers
Readme
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