Skip to content

agarimojs/lru-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lru-cache

LRU Cache using double linked list

Usage

Create the LRUCache with the capacity as parameter. If no capacity is provided, default will be 10000. Use put to add a (key, value) item. Use get to get to get the value given the key.

const cache = new LRUCache(500);

cache.put('a', { name: 'something' });
cache.put('b', { name: 'other' });
const result = cache.get('a');
console.log(result);

About

LRU Cache using double linked list

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published