package
LRU Cache for node.js/browser.
npm install lrucacheGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
npm install lrucachebower:
bower install lrucacheBrowser:
<script src="/pathTo/lrucache.js"></script>const LRUCache = require('lrucache')capacity: : Optional, Type: Number, Default: Number.MAX_SAFE_INTEGER.const cache = LRUCache(100)Return value.
let a = cache.get('a')Return this.
cache.set('a', [1, 2, 3])Return this, It only run when key exists.
cache.update('a', function (a) {
a.push(4)
return a
})Return this.
cache.remove('a')Return this.
cache.removeAll()Return a array of keys.
cache.keys()Return true or false.
cache.has('a')Return the stalest key or null.
let staleKey = cache.staleKey()Return the stalest data or null.
let staleDate = cache.popStale()Return info.
cache.info()