{"name":"xache","version":"1.2.1","description":"Yet another auto expiring, max sizable cache","main":"index.js","devDependencies":{"brittle":"^3.3.2","standard":"^17.1.0"},"scripts":{"test":"standard && brittle 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","_id":"xache@1.2.1","gitHead":"5d68fea5677ce06b537b1bd72dd832af8b457163","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-igRS6jPreJ54ABdzhh4mCDXcz+XMaWO2q1ABRV2yWYuk29jlp8VT7UBdCqNkX7rpYBbXsebVVKkwIuYZjyZNqA==","shasum":"0c2041ba13d8c60d2e10214a0ce99894315f9349","tarball":"http://registry-npm.ywwl.com/xache/download/xache-1.2.1.tgz","fileCount":4,"unpackedSize":4631,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDQIdYPGOZeP6/c3/r5fR7oG9s1CuHy3zOPiQeeO1I0pAiA6z1YxmqahbsUN955sZxwB8QGOmsPJvve8llxIwJ9p2Q=="}],"size":2009,"noattachment":false,"key":"/xache/-/xache-1.2.1.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/xache_1.2.1_1707343645556_0.18116465729211018"},"_hasShrinkwrap":false,"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  createMap () { // optional function to create backing storage\n    return new Map()\n  }\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","publish_time":1707343645703,"_cnpm_publish_time":1707343645703,"dist-tags":{"latest":"1.3.0"}}