{"name":"xache","version":"1.3.0","description":"Yet another auto expiring, max sizable cache","main":"index.js","devDependencies":{"brittle":"^3.3.2","prettier":"^3.6.2","prettier-config-holepunch":"^1.0.0"},"scripts":{"format":"prettier --write .","test":"prettier --check . && 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":"84cf91bca2e0bd0306d83fc8f5a01adc5b672a37","_id":"xache@1.3.0","_nodeVersion":"24.13.0","_npmVersion":"11.15.0","dist":{"integrity":"sha512-ekAknjLTiyXJcuezqwa/cOMfFenVVY2toL4J7D3AfTn7UEDYb8JSgRnv3CK8khF7u38XZ4NjS1MXEw4RwqJ4oA==","shasum":"499f83433f928bb2a72a0d0b21320ce474962e68","tarball":"http://registry-npm.ywwl.com/xache/download/xache-1.3.0.tgz","fileCount":4,"unpackedSize":4820,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFFF3SbvOKLR8WuxfhoOenzhhda9G3NT35QlDZwb5iUkAiA1CakGvCcvx2MMR8nJ2AaFpi3W+DWOcfXazHrzbHCSbg=="}],"size":2075,"noattachment":false,"key":"/xache/-/xache-1.3.0.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/xache_1.3.0_1784115305627_0.9945972109983825"},"_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() {\n    // 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":1784115305748,"_cnpm_publish_time":1784115305748,"dist-tags":{"latest":"1.3.0"}}