{ "name": "lru-cache", "description": "A cache object that deletes the least-recently-used items.", "version": "1.1.1", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me" }, "scripts": { "test": "tap test" }, "main": "lib/lru-cache.js", "repository": { "type": "git", "url": "git://github.com/isaacs/node-lru-cache.git" }, "devDependencies": { "tap": "" }, "license": { "type": "MIT", "url": "http://github.com/isaacs/node-lru-cache/raw/master/LICENSE" }, "contributors": [ { "name": "Isaac Z. Schlueter", "email": "i@izs.me" }, { "name": "Carlos Brito Lage", "email": "carlos@carloslage.net" }, { "name": "Marko Mikulicic", "email": "marko.mikulicic@isti.cnr.it" }, { "name": "Trent Mick", "email": "trentm@gmail.com" }, { "name": "Kevin O'Hara", "email": "kevinohara80@gmail.com" }, { "name": "Marco Rogers", "email": "marco.rogers@gmail.com" } ], "readme": "# lru cache\n\nA cache object that deletes the least-recently-used items.\n\nUsage:\n\n var LRU = require(\"lru-cache\")\n , cache = LRU(10, // max length. default = Infinity\n\n // calculate how \"big\" each item is\n //\n // defaults to function(){return 1}, ie, just limit\n // the item count, without any knowledge as to their\n // relative size.\n function (item) { return item.length },\n\n // maxAge in ms\n // defaults to infinite\n // items are not pre-emptively pruned, but they\n // are deleted when fetched if they're too old.\n 1000 * 60)\n\n cache.set(\"key\", \"value\")\n cache.get(\"key\") // \"value\"\n\n cache.reset() // empty the cache\n\nIf you put more stuff in it, then items will fall out.\n\nIf you try to put an oversized thing in it, then it'll fall out right\naway.\n\nRTFS for more info.\n", "_id": "lru-cache@1.1.1", "_from": "lru-cache@~1.1.0" }