sru

1.0.5 • Public • Published

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

Package Sidebar

Install

npm i sru

Weekly Downloads

0

Version

1.0.5

License

MIT

Unpacked Size

5.46 kB

Total Files

6

Last publish

Collaborators

  • dcousens