lru

A simple O(1) LRU cache

npm install lru
8 downloads in the last week
42 downloads in the last month

A simple LRU cache supporting O(1) set, get and eviction of old keys

Installation

$ npm install lru

Usage

var LRU = require('lru').LRU;

var cache = new LRU(10);

cache.set('foo', 'bar');
cache.get('foo'); //=> bar

Credits

A big thanks to Dusty Leary who finished the library.

npm loves you