{"_id":"xache","_rev":"481478","name":"xache","description":"Yet another auto expiring, max sizable cache","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"mafintosh","email":""}],"time":{"modified":"2021-08-05T09:39:07.000Z","created":"2021-05-21T20:19:04.708Z","1.0.0":"2021-05-21T20:19:04.708Z"},"users":{},"author":{"name":"Mathias Buus","url":"@mafintosh"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/xache.git"},"versions":{"1.0.0":{"name":"xache","version":"1.0.0","description":"Yet another auto expiring, max sizable cache","main":"index.js","dependencies":{},"devDependencies":{"standard":"^16.0.3","tape":"^5.2.2"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/xache.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/xache/issues"},"homepage":"https://github.com/mafintosh/xache","gitHead":"1701debfcd0accbc729845e83d657e81cb7704b3","_id":"xache@1.0.0","_nodeVersion":"16.1.0","_npmVersion":"6.14.13","dist":{"shasum":"a252f8cbbe80e654ea4266bf172ca86e287be145","size":2341,"noattachment":false,"key":"/xache/-/xache-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/xache/download/xache-1.0.0.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/xache_1.0.0_1621628344567_0.8400356690538555"},"_hasShrinkwrap":false,"publish_time":1621628344708,"_cnpm_publish_time":1621628344708}},"readme":"# xache\n\nYet another auto expiring, max sizable cache\n\n```\nnpm install xache\n```\n\n## Usage\n\n``` js\nconst Xache = require('xache')\n\nconst cache = new Xache({\n  maxSize: 10, // at max (ish) have 10 entries\n  maxAge: 100 // auto expire entries after (ish) 100ms\n})\n\n// When maxSize is hit, the oldest entries are removed\n// cache has the same api as a map\n\ncache.set('hello', 'world')\nconsole.log(cache.get('hello'))\n\nconsole.log(...cache) // iterable!\n```\n\nThat's it, nice and simple.\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/mafintosh/xache","bugs":{"url":"https://github.com/mafintosh/xache/issues"},"license":"MIT"}