auto-fill-lru

1.0.1 • Public • Published

auto-fill-lru

A LRU cache with a provider function to auto-cache itens

Build CI

Installing

npm install auto-fill-lru

Examples

 
function slowFunction(key) {
  return new Promise((resolve) => {
    setTimeout(() => resolve(100), 1000);
  });
}
 
const instance = new LRU({
  retrieveFunction: slowFunction,
});
 
result = await intance.get('1'); // return after 1s
 
result2 = await instance.get('1'); // return imediatly

/auto-fill-lru/

    Package Sidebar

    Install

    npm i auto-fill-lru

    Weekly Downloads

    0

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    18.4 kB

    Total Files

    15

    Last publish

    Collaborators

    • edgardleal