{"name":"xache","version":"1.2.0","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","gitHead":"c98c7c8104a70117519973538725c66339dfcae6","_id":"xache@1.2.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-AiWCGTrnsh//rrbJt8DLbDkDW8eLp1Ktkq0nTWzpE+FKCY35oeqLjtz+LNb4abMnjfTgL0ZBaSwzhgzan1ocEw==","shasum":"c7239cbec9d8445c9d691feec804298d5ae5eae9","tarball":"http://registry-npm.ywwl.com/xache/download/xache-1.2.0.tgz","fileCount":6,"unpackedSize":6939,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDIE2vOyDV+p8CUDdnyGgm2ytYP6oU1R+Lj9yumaqer8QIhAOiP0SEM7sUyW3bKyMQoP0yDcHepd+FtOSGn22Ui9g1z"}],"size":2645,"noattachment":false,"key":"/xache/-/xache-1.2.0.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.0_1695383945524_0.6419522201029222"},"_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":1695383945776,"_cnpm_publish_time":1695383945776,"dist-tags":{"latest":"1.3.0"}}