lruly
v0.0.8
Published
lruly implements an LRU cache.
Downloads
18
Readme
lruly
Implements an LRU cache.
var lruly = require('lruly');
var cache = lruly();
cache.add('foo', 'hello world');Installation
$ npm install -g lrulyQuick Start
Create the LRU cache and set maxEntries,
if maxEntries is zero, the cache has no limit:
var cache = lruly(8964);Add a entiry:
cache.add('module', { version: '0.0.1', name: 'lruly' });Get the entry's value:
cache.get('module'); // { version: '0.0.1', name: 'lruly' }Remove the entiry by key:
cache.remove('module');Get the number of entries in the cache:
cache.len();