94 lines
6.7 KiB
JSON
94 lines
6.7 KiB
JSON
{
|
|
"_args": [
|
|
[
|
|
{
|
|
"raw": "lru-cache@^2.6.5",
|
|
"scope": null,
|
|
"escapedName": "lru-cache",
|
|
"name": "lru-cache",
|
|
"rawSpec": "^2.6.5",
|
|
"spec": ">=2.6.5 <3.0.0",
|
|
"type": "range"
|
|
},
|
|
"/home/jdaugherty/work/GT2/GT2-Android/node_modules/proxy-agent"
|
|
]
|
|
],
|
|
"_from": "lru-cache@>=2.6.5 <3.0.0",
|
|
"_id": "lru-cache@2.7.3",
|
|
"_inCache": true,
|
|
"_location": "/proxy-agent/lru-cache",
|
|
"_nodeVersion": "4.0.0",
|
|
"_npmUser": {
|
|
"name": "isaacs",
|
|
"email": "i@izs.me"
|
|
},
|
|
"_npmVersion": "3.3.2",
|
|
"_phantomChildren": {},
|
|
"_requested": {
|
|
"raw": "lru-cache@^2.6.5",
|
|
"scope": null,
|
|
"escapedName": "lru-cache",
|
|
"name": "lru-cache",
|
|
"rawSpec": "^2.6.5",
|
|
"spec": ">=2.6.5 <3.0.0",
|
|
"type": "range"
|
|
},
|
|
"_requiredBy": [
|
|
"/proxy-agent"
|
|
],
|
|
"_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz",
|
|
"_shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952",
|
|
"_shrinkwrap": null,
|
|
"_spec": "lru-cache@^2.6.5",
|
|
"_where": "/home/jdaugherty/work/GT2/GT2-Android/node_modules/proxy-agent",
|
|
"author": {
|
|
"name": "Isaac Z. Schlueter",
|
|
"email": "i@izs.me"
|
|
},
|
|
"bugs": {
|
|
"url": "https://github.com/isaacs/node-lru-cache/issues"
|
|
},
|
|
"dependencies": {},
|
|
"description": "A cache object that deletes the least-recently-used items.",
|
|
"devDependencies": {
|
|
"tap": "^1.2.0",
|
|
"weak": ""
|
|
},
|
|
"directories": {},
|
|
"dist": {
|
|
"shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952",
|
|
"tarball": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz"
|
|
},
|
|
"gitHead": "292048199f6d28b77fbe584279a1898e25e4c714",
|
|
"homepage": "https://github.com/isaacs/node-lru-cache#readme",
|
|
"keywords": [
|
|
"mru",
|
|
"lru",
|
|
"cache"
|
|
],
|
|
"license": "ISC",
|
|
"main": "lib/lru-cache.js",
|
|
"maintainers": [
|
|
{
|
|
"name": "isaacs",
|
|
"email": "isaacs@npmjs.com"
|
|
},
|
|
{
|
|
"name": "othiym23",
|
|
"email": "ogd@aoaioxxysz.net"
|
|
}
|
|
],
|
|
"name": "lru-cache",
|
|
"optionalDependencies": {},
|
|
"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## Keys should always be Strings or Numbers\n\nNote: this module will print warnings to `console.error` if you use a\nkey that is not a String or Number. Because items are stored in an\nobject, which coerces keys to a string, it won't go well for you if\nyou try to use a key that is not a unique string, it'll cause surprise\ncollisions. For example:\n\n```JavaScript\n// Bad Example! Dont' do this!\nvar cache = LRU()\nvar a = {}\nvar b = {}\ncache.set(a, 'this is a')\ncache.set(b, 'this is b')\nconsole.log(cache.get(a)) // prints: 'this is b'\n```\n\n## Options\n\n* `max` The maximum size of the cache, checked by applying the length\n function to all values in the cache. 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 `max`\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* `stale` By default, if you set a `maxAge`, it'll only actually pull\n stale items out of the cache when you `get(key)`. (That is, it's\n not pre-emptively doing a `setTimeout` or anything.) If you set\n `stale:true`, it'll return the stale value before deleting it. If\n you don't set this, then it'll return `undefined` when you try to\n get a stale entry, as if it had already been deleted.\n\n## API\n\n* `set(key, value, maxAge)`\n* `get(key) => value`\n\n Both of these will update the \"recently used\"-ness of the key.\n They do what you think. `max` is optional and overrides the\n cache `max` option if provided.\n\n* `peek(key)`\n\n Returns the key value (or `undefined` if not found) without\n updating the \"recently used\"-ness of the key.\n\n (If you find yourself using this a lot, you *might* be using the\n wrong sort of data structure, but there are some use cases where\n it's handy.)\n\n* `del(key)`\n\n Deletes a key out of the cache.\n\n* `reset()`\n\n Clear the cache entirely, throwing away all values.\n\n* `has(key)`\n\n Check if a key is in the cache, without updating the recent-ness\n or deleting it for being stale.\n\n* `forEach(function(value,key,cache), [thisp])`\n\n Just like `Array.prototype.forEach`. Iterates over all the keys\n in the cache, in order of recent-ness. (Ie, more recently used\n items are iterated over first.)\n\n* `keys()`\n\n Return an array of the keys in the cache.\n\n* `values()`\n\n Return an array of the values in the cache.\n\n* `length()`\n\n Return total length of objects in cache taking into account\n `length` options function.\n\n* `itemCount`\n\n Return total quantity of objects currently in cache. Note, that\n `stale` (see options) items are returned as part of this item\n count.\n\n* `dump()`\n\n Return an array of the cache entries ready for serialization and usage\n with 'destinationCache.load(arr)`.\n\n* `load(cacheEntriesArray)`\n\n Loads another cache entries array, obtained with `sourceCache.dump()`,\n into the cache. The destination cache is reset before loading new entries\n",
|
|
"readmeFilename": "README.md",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git://github.com/isaacs/node-lru-cache.git"
|
|
},
|
|
"scripts": {
|
|
"test": "tap test --gc"
|
|
},
|
|
"version": "2.7.3"
|
|
}
|