diff options
author | isaacs <i@izs.me> | 2012-08-15 07:07:09 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-08-15 07:07:09 +0400 |
commit | 2df0ce5e6fa04036c95f2ad63e1b0c61edef1970 (patch) | |
tree | d8560d845d0bc260e6b63a0986721a7d58d0e1b4 | |
parent | eca5f88a73b8f13ce36bea2604d1917bbe19a94e (diff) |
lru-cache@2.0.1
-rw-r--r-- | node_modules/lru-cache/lib/lru-cache.js | 2 | ||||
-rw-r--r-- | node_modules/lru-cache/package.json | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/node_modules/lru-cache/lib/lru-cache.js b/node_modules/lru-cache/lib/lru-cache.js index 47b72baee..27a9a5e93 100644 --- a/node_modules/lru-cache/lib/lru-cache.js +++ b/node_modules/lru-cache/lib/lru-cache.js @@ -27,7 +27,7 @@ function LRUCache (options) { if (!options) options = {} - lengthCalculator = options.length || naiveLength + var lengthCalculator = options.length || naiveLength if (typeof lengthCalculator !== "function") { lengthCalculator = naiveLength diff --git a/node_modules/lru-cache/package.json b/node_modules/lru-cache/package.json index 9af46c417..e2457f720 100644 --- a/node_modules/lru-cache/package.json +++ b/node_modules/lru-cache/package.json @@ -1,7 +1,7 @@ { "name": "lru-cache", "description": "A cache object that deletes the least-recently-used items.", - "version": "2.0.0", + "version": "2.0.1", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me" @@ -48,6 +48,9 @@ } ], "readme": "# lru cache\n\nA cache object that deletes the least-recently-used items.\n\n## Usage:\n\n```javascript\nvar LRU = require(\"lru-cache\")\n , options = { max: 500\n , length: function (n) { return n * 2 }\n , dispose: function (key, n) { n.close() }\n , maxAge: 1000 * 60 * 60 }\n , cache = LRU(options)\n , otherCache = LRU(50) // sets just the max size\n\ncache.set(\"key\", \"value\")\ncache.get(\"key\") // \"value\"\n\ncache.reset() // empty the cache\n```\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\n## Options\n\n* `max` The maximum number of items. Not setting this is kind of\n silly, since that's the whole purpose of this lib, but it defaults\n to `Infinity`.\n* `maxAge` Maximum age in ms. Items are not pro-actively pruned out\n as they age, but if you try to get an item that is too old, it'll\n drop it and return undefined instead of giving it to you.\n* `length` Function that is used to calculate the length of stored\n items. If you're storing strings or buffers, then you probably want\n to do something like `function(n){return n.length}`. The default is\n `function(n){return 1}`, which is fine if you want to store `n`\n like-sized things.\n* `dispose` Function that is called on items when they are dropped\n from the cache. This can be handy if you want to close file\n descriptors or do other cleanup tasks when items are no longer\n accessible. Called with `key, value`. It's called *before*\n actually removing the item from the internal cache, so if you want\n to immediately put it back in, you'll have to do that in a\n `nextTick` or `setTimeout` callback or it won't do anything.\n", - "_id": "lru-cache@2.0.0", - "_from": "lru-cache@latest" + "_id": "lru-cache@2.0.1", + "dist": { + "shasum": "8cbbcca2f72b07e18510cb1451073cd4afab0826" + }, + "_from": "lru-cache@2.0.1" } |