1.0.5 • Published 6 years ago

sru v1.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

sru

build status Version

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

License MIT