{"_id":"level-lru-cache","_rev":"9-bc285ab76777b5d64f88b8edaa6d0025","name":"level-lru-cache","description":"simple LRU cache atop LevelUp","dist-tags":{"latest":"1.0.0"},"versions":{"0.1.0":{"name":"level-lru-cache","description":"simple LRU cache atop LevelUp","version":"0.1.0","author":{"name":"Kyle E. Mitchell","email":"kyle@kemitchell.com","url":"https://kemitchell.com/"},"dependencies":{"bytewise":"~1.1.0"},"devDependencies":{"levelup":"~1.2.1","memdown":"~1.0.0","tape":"~4.2.0"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/kemitchell/level-lru-cache.js.git"},"scripts":{"test":"tape test.js"},"gitHead":"ecd2f3af34a6cc5b980a78cb475403a37b21a3bc","bugs":{"url":"https://github.com/kemitchell/level-lru-cache.js/issues"},"homepage":"https://github.com/kemitchell/level-lru-cache.js#readme","_id":"level-lru-cache@0.1.0","_shasum":"deedb532dc8b2e34b173d273771dd7b579d936e8","_from":".","_npmVersion":"2.14.1","_nodeVersion":"0.12.7","_npmUser":{"name":"kemitchell","email":"kyle@kemitchell.com"},"dist":{"shasum":"deedb532dc8b2e34b173d273771dd7b579d936e8","tarball":"https://registry.npmjs.org/level-lru-cache/-/level-lru-cache-0.1.0.tgz","integrity":"sha512-lUpW0l0g3lhacZ0nWJ97Z/s8dLqclhRPhWk6BKaguF2iENVn/DRjGeWb2rlHt4iS8Bozl09EIcbVIXt7w2fuxg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGTuxYruIx6PVfqWcPVh+htTHCiEiqhZuQH8Pc7re02iAiEAuZYW7klW55Vj4rLMAyfvNKFPhs3IKbEyKacSOQB6YiY="}]},"maintainers":[{"name":"kemitchell","email":"kyle@kemitchell.com"}]},"0.1.1":{"name":"level-lru-cache","description":"simple LRU cache atop LevelUp","version":"0.1.1","author":{"name":"Kyle E. Mitchell","email":"kyle@kemitchell.com","url":"https://kemitchell.com/"},"dependencies":{"bytewise":"^1.1.0"},"devDependencies":{"levelup":"~1.2.1","memdown":"~1.0.0","tape":"~4.2.0"},"keywords":["cache","level","lru"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/kemitchell/level-lru-cache.js.git"},"scripts":{"test":"tape test.js"},"gitHead":"b3fc5c41cc0c4a570ec77ed92741e2931a0db63d","bugs":{"url":"https://github.com/kemitchell/level-lru-cache.js/issues"},"homepage":"https://github.com/kemitchell/level-lru-cache.js#readme","_id":"level-lru-cache@0.1.1","_shasum":"194099ffbafc984af291c5abfa52c42dac4caf3a","_from":".","_npmVersion":"2.14.1","_nodeVersion":"0.12.7","_npmUser":{"name":"kemitchell","email":"kyle@kemitchell.com"},"dist":{"shasum":"194099ffbafc984af291c5abfa52c42dac4caf3a","tarball":"https://registry.npmjs.org/level-lru-cache/-/level-lru-cache-0.1.1.tgz","integrity":"sha512-5R25zKQNs5o6doMDa+3XIj7Qhqm0oGlyfaMoC0qcTCC/rxTa+9LhVUUqPuZ8AY5u1e5wl8tMDYMEnTZWyVfL8w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEIci9vPEMJXynId0Zvnjh+mW6Px8KONgpgLtohA6lBYAiAbAqUreTIWW6I+/Ckags32YgqUrqnpRynut0wajF9RVA=="}]},"maintainers":[{"name":"kemitchell","email":"kyle@kemitchell.com"}]},"0.1.2":{"name":"level-lru-cache","description":"simple LRU cache atop LevelUp","version":"0.1.2","author":{"name":"Kyle E. Mitchell","email":"kyle@kemitchell.com","url":"https://kemitchell.com/"},"dependencies":{"bytewise":"^1.1.0"},"devDependencies":{"levelup":"~1.2.1","memdown":"~1.0.0","tape":"~4.2.0"},"keywords":["cache","level","lru"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/kemitchell/level-lru-cache.js.git"},"scripts":{"test":"tape test.js"},"gitHead":"a8064b9998f3bdb715963c99848fda07c408bf38","bugs":{"url":"https://github.com/kemitchell/level-lru-cache.js/issues"},"homepage":"https://github.com/kemitchell/level-lru-cache.js#readme","_id":"level-lru-cache@0.1.2","_shasum":"8ee731ac68257b1c6e8f03feaed7108f429def50","_from":".","_npmVersion":"2.14.1","_nodeVersion":"0.12.7","_npmUser":{"name":"kemitchell","email":"kyle@kemitchell.com"},"dist":{"shasum":"8ee731ac68257b1c6e8f03feaed7108f429def50","tarball":"https://registry.npmjs.org/level-lru-cache/-/level-lru-cache-0.1.2.tgz","integrity":"sha512-GZHUXxe60t9xo20IwbrbCH2jD+zdxAPZeNwpfGErv5JLBOLKiU3EtF5wDlotc8VAlKftAtXIO5JprgLwxWvVtA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGMx1C3a+R7L2QKsvUJGxP9dAknj7TTJ2Wfq9oGdPBpGAiApDMRmIu0ztQ6mExazAy76oulIpEJAWZJyd0TsS09ayw=="}]},"maintainers":[{"name":"kemitchell","email":"kyle@kemitchell.com"}]},"0.1.3":{"name":"level-lru-cache","description":"simple LRU cache atop LevelUp","version":"0.1.3","author":{"name":"Kyle E. Mitchell","email":"kyle@kemitchell.com","url":"https://kemitchell.com/"},"dependencies":{"bytewise":"^1.1.0"},"devDependencies":{"levelup":"~1.2.1","memdown":"~1.0.0","tape":"~4.2.0"},"keywords":["cache","level","lru"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/kemitchell/level-lru-cache.js.git"},"scripts":{"test":"tape test.js"},"gitHead":"4b534f6a51e35fb00ec81e707b0a33d746290c86","bugs":{"url":"https://github.com/kemitchell/level-lru-cache.js/issues"},"homepage":"https://github.com/kemitchell/level-lru-cache.js#readme","_id":"level-lru-cache@0.1.3","_shasum":"e958daf5b211e6e3aaa7e4e7a6b78cfdd8bfca02","_from":".","_npmVersion":"2.14.1","_nodeVersion":"0.12.7","_npmUser":{"name":"kemitchell","email":"kyle@kemitchell.com"},"dist":{"shasum":"e958daf5b211e6e3aaa7e4e7a6b78cfdd8bfca02","tarball":"https://registry.npmjs.org/level-lru-cache/-/level-lru-cache-0.1.3.tgz","integrity":"sha512-PLpzVsNAOpLhnzrfbDbJuGJeu9D6R/gt7nSUu6OchJqYYfk+resIJcbRuQATucCDeAT/EoVEfbnp0OfaP23Oow==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmk80DOvLC/voRpyWqjz6fiRddUtlIpttu+8DTglSGewIgdYRfRLepLlrzSlmUIu34MQ64r5TZ8iU435cUrfw+TgU="}]},"maintainers":[{"name":"kemitchell","email":"kyle@kemitchell.com"}]},"0.1.4":{"name":"level-lru-cache","description":"simple LRU cache atop LevelUp","version":"0.1.4","author":{"name":"Kyle E. Mitchell","email":"kyle@kemitchell.com","url":"https://kemitchell.com/"},"dependencies":{"bytewise":"^1.1.0"},"devDependencies":{"levelup":"~1.2.1","memdown":"~1.0.0","tape":"~4.2.0"},"keywords":["cache","level","lru"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/kemitchell/level-lru-cache.js.git"},"scripts":{"test":"tape test.js"},"gitHead":"5c2dc09d520b1a72a97981349eb5d43ff705136d","bugs":{"url":"https://github.com/kemitchell/level-lru-cache.js/issues"},"homepage":"https://github.com/kemitchell/level-lru-cache.js#readme","_id":"level-lru-cache@0.1.4","_shasum":"6c78ae4a91ad1934443d828b085b38e3f9d7c6ba","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"kemitchell","email":"kyle@kemitchell.com"},"maintainers":[{"name":"kemitchell","email":"kyle@kemitchell.com"}],"dist":{"shasum":"6c78ae4a91ad1934443d828b085b38e3f9d7c6ba","tarball":"https://registry.npmjs.org/level-lru-cache/-/level-lru-cache-0.1.4.tgz","integrity":"sha512-Uin/AjVsqqBrZIWEd7cpx6By9tUd1F74J3H+RzmYwPIcevmkkDeaDGzV1HZb0S+ucYgRsufUldszhiV7XebE1w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLEAAWbY3UfQS9rW3Fyskfx75iQ1jzO0GasOOR06KZogIhALNsoT3HTBItWEfwkQlk1t8PEpMTuwyxgJbni5p+I8JZ"}]}},"0.1.5":{"name":"level-lru-cache","description":"simple LRU cache atop LevelUp","version":"0.1.5","author":{"name":"Kyle E. Mitchell","email":"kyle@kemitchell.com","url":"https://kemitchell.com/"},"dependencies":{"bytewise":"^1.1.0"},"devDependencies":{"async-series":"0.0.1","levelup":"~1.2.1","memdown":"~1.0.0","tape":"~4.2.0"},"keywords":["cache","level","lru"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/kemitchell/level-lru-cache.js.git"},"scripts":{"test":"tape test.js"},"gitHead":"5f0b2e23aac1e75698789f3a574f88936eb02f95","bugs":{"url":"https://github.com/kemitchell/level-lru-cache.js/issues"},"homepage":"https://github.com/kemitchell/level-lru-cache.js#readme","_id":"level-lru-cache@0.1.5","_shasum":"82aabd2c63c5462505924dae74913abf9f5d694e","_from":".","_npmVersion":"2.14.1","_nodeVersion":"0.12.7","_npmUser":{"name":"kemitchell","email":"kyle@kemitchell.com"},"dist":{"shasum":"82aabd2c63c5462505924dae74913abf9f5d694e","tarball":"https://registry.npmjs.org/level-lru-cache/-/level-lru-cache-0.1.5.tgz","integrity":"sha512-NaY/xR+9HZfyfAqV1S5B4y8oABUHpyAgrJSZ0N/EPnQopD9f1dzN0M1HPFiu7KzSeJBtu5IncgIXsCjmo2et8g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBe2Tw+ErJaAloiKsaQMkyJ1ElIhg9NCHwwcpmj/54oFAiBKkUbC3awPG4cPJtzPY4G9rHXObWNOfhBiel70ZAUTTg=="}]},"maintainers":[{"name":"kemitchell","email":"kyle@kemitchell.com"}]},"1.0.0":{"name":"level-lru-cache","description":"simple LRU cache atop LevelUp","version":"1.0.0","author":{"name":"Kyle E. Mitchell","email":"kyle@kemitchell.com","url":"https://kemitchell.com/"},"dependencies":{"bytewise":"^1.1.0","ecb":"^1.0.0"},"devDependencies":{"async-series":"^0.0.1","levelup":"^1.2.1","memdown":"^1.0.0","standard":"^8.0.0","tape":"^4.2.0"},"files":["index.js","public","private"],"keywords":["cache","level","lru"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/kemitchell/level-lru-cache.js.git"},"scripts":{"lint":"standard","test":"tape test.js"},"gitHead":"85494b83f9e460297f7a1c25f161bc435f17787e","bugs":{"url":"https://github.com/kemitchell/level-lru-cache.js/issues"},"homepage":"https://github.com/kemitchell/level-lru-cache.js#readme","_id":"level-lru-cache@1.0.0","_shasum":"b28c364464a7dac80e5d0ea971dbedd3ca84f1d8","_from":".","_npmVersion":"3.10.6","_nodeVersion":"4.5.0","_npmUser":{"name":"kemitchell","email":"kyle@kemitchell.com"},"dist":{"shasum":"b28c364464a7dac80e5d0ea971dbedd3ca84f1d8","tarball":"https://registry.npmjs.org/level-lru-cache/-/level-lru-cache-1.0.0.tgz","integrity":"sha512-QOTysbEBkTxCnPV+wwXsWwgt3bt85sB7XCz9IQT5x7NGFrvG6Dz0tEXHvBHJ7PDjpOR4QBw3Rz3ZFoll2OUZ5w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCMcJcmGDcYWc2Sz8inrySxgDbnJ8nc/kFSEYXQKuOHpQIhALdRf5+K2RCHk/UxbZ+FbP/LHKwqskF00bjZebX9gVGQ"}]},"maintainers":[{"name":"kemitchell","email":"kyle@kemitchell.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/level-lru-cache-1.0.0.tgz_1472032804618_0.00947783445008099"}}},"readme":"# Usage\n\n```javascript\nvar Cache = require('level-lru-cache')\nvar levelup = require('levelup')\nvar memdown = require('memdown')\n\n// Any sane LevelDOWN will do.\nvar level = levelup({db: memdown})\n// A loose limit for how many keys the cache should store.\nvar limit = 100\n\nvar cache = new Cache(level, limit)\n\ncache.put('string key', value, function(error) {\n  /* ... */\n})\n\ncache.get('string key', function(error, value) {\n  /* Value is `undefined` if the cache doesn't have a value. */\n})\n```\n\n# Under the Hood\n\nThe cache stores values as records. Each record's key combines the\ncache key and a timestamp. On `put`, the cache counts stored records,\ncompares to the cache limit, if any, and deletes records for the oldest\nkeys as it adds a record for the new value. On `get`, the cache finds\nall the records for the key, deletes them all, notes the most recent\nvalue, creates a new record for the value, and returns the value.\n\nThe general idea is to avoid issues where:\n\n1. A first `put` performs LevelUP read operations. They indicate the\n   cache is about to bust its limit, and that key `'x'` is the oldest.\n\n2. Another operation reads or writes the cached value for `'x'`.\n\n3. The first `put` operation performs its LevelUP write operations,\n   deleting `'x'`, which should actually be the most recently used\n   value in the cache.\n\nThe use of timestamps isn't ideal, but it probably works when the\nasynchronous clients of the underling LevelUP are on the same machine.\n","maintainers":[{"name":"kemitchell","email":"kyle@kemitchell.com"}],"time":{"modified":"2022-06-19T11:49:12.335Z","created":"2015-09-05T23:05:00.873Z","0.1.0":"2015-09-05T23:05:00.873Z","0.1.1":"2015-09-05T23:24:51.665Z","0.1.2":"2015-09-05T23:50:51.046Z","0.1.3":"2015-09-06T00:15:40.549Z","0.1.4":"2015-09-06T21:22:38.942Z","0.1.5":"2015-09-07T03:44:55.325Z","1.0.0":"2016-08-24T10:00:08.212Z"},"homepage":"https://github.com/kemitchell/level-lru-cache.js#readme","repository":{"type":"git","url":"git+https://github.com/kemitchell/level-lru-cache.js.git"},"author":{"name":"Kyle E. Mitchell","email":"kyle@kemitchell.com","url":"https://kemitchell.com/"},"bugs":{"url":"https://github.com/kemitchell/level-lru-cache.js/issues"},"license":"MIT","readmeFilename":"README.md","keywords":["cache","level","lru"]}