{"name":"expiry-map","version":"1.0.2","description":"A Map implementation with expirable items","license":"MIT","repository":{"type":"git","url":"git+https://github.com/SamVerschueren/expiry-map.git"},"author":{"name":"Sam Verschueren","email":"sam.verschueren@gmail.com","url":"github.com/SamVerschueren"},"main":"dist/index.js","engines":{"node":">=6"},"scripts":{"prepublishOnly":"npm run build","pretest":"npm run build -- --sourceMap","test":"npm run lint && nyc ava dist/test.js","lint":"tslint --format stylish --project .","build":"npm run clean && tsc","clean":"del-cli dist"},"files":["dist/index.js","dist/index.d.ts"],"keywords":["map","cache","caching","ttl","expire","expiring","expiry"],"devDependencies":{"@types/delay":"^2.0.1","@types/node":"^10.5.8","ava":"^0.25.0","codecov":"^3.0.4","del-cli":"^1.1.0","delay":"^3.0.0","nyc":"^12.0.2","tslint":"^5.10.0","tslint-xo":"^0.8.0","typescript":"^3.0.1"},"typings":"dist/index.d.ts","sideEffects":false,"nyc":{"exclude":["dist/test.js"]},"gitHead":"cce57ab5670a95a2758f4f44aaf16fddd201f45b","bugs":{"url":"https://github.com/SamVerschueren/expiry-map/issues"},"homepage":"https://github.com/SamVerschueren/expiry-map#readme","_id":"expiry-map@1.0.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"samverschueren","email":"sam.verschueren@gmail.com"},"dist":{"integrity":"sha512-GEJCsOxmzGU1klYdzsdFyL/GF5Yw6ZS+Ns9smqEKF5tla/PSYQtVEN3dj58eOtiR5xFRyJ6nfGU+ZD/XRqRaMA==","shasum":"4a69afa8d8d620a26d653214720c1d9ef909a590","tarball":"http://registry-npm.ywwl.com/expiry-map/download/expiry-map-1.0.2.tgz","fileCount":5,"unpackedSize":6503,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbdAVECRA9TVsSAnZWagAAJqwQAJgjbeQ0GxQxEaMMqtAD\nD8AKwsUrJ26NxuUSlgN0pDux7+pR7EqOxyfHBgy33e8wwiJbFSft/Ll6rFvA\nxDIQDi6//swN6AKbT/cf0jH6NrrIXhKRmr+fGO3prrxlJNQ/iM0KYTHlCqGg\ng3jZC8ghgpMtlWWJ7ktffrLIzi1ks+Oh3sU8z0ZrvyYJgsZIgKQOFfTdW7t0\nK/L4jpNiPoKJfFGUjtVHUrQO9GQ6RqRTO/TBCSggcdFzwK7DkgG2lFvmhB1T\n4V5SW0tb2Qp9qDJpW6cg95QugvhK/PJe+yCeWcMLOu+mmofg1EN+MrF7SVHt\nYQzyqxXl7QGH5OKNIzWOUJ6O5jerISxoLx/KyAyZtTqwoDzkAT+Mg9a4T3tp\neV5ZHybxiwC+rFWQ5EIpkU9odkLdviiVXaQICOEWmx+iccZnPMgW8+oBr5r8\nrr9X8D77Sz7af1mnTrhvjlyWJxYb88pjkDQlcCKA+YEQ24Mx/oYByiGUSId6\nSSGUb/j1so8SI/zfqkhSsOxpzzzBprvGyj4AtB7d/46K4J8MauVZ7GJhO2fS\nB5DF/ranChYg8BrMi5hHgngQA7YjqSmzPwYB/HNyZzYnzhpftlmkBkyxJsih\nVrhryIevK7LyAWNF7xaNY5ZxPICfagp7Gsm0cwtd5uiWaFOR4jPb7f2O/qBN\nOKyR\r\n=KA7A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcWI/S40IdkA7tzmp9tOBA7JGu2apyGXiRWxsKSbDprgIgX3/1GaYhDyR6gNEMpvl2sKhkN361/Xb39pqcpZurB4Y="}],"size":2794,"noattachment":false,"key":"/expiry-map/-/expiry-map-1.0.2.tgz"},"maintainers":[{"name":"samverschueren","email":"sam.verschueren@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/expiry-map_1.0.2_1534330180314_0.020967068178896042"},"_hasShrinkwrap":false,"readme":"# expiry-map\n\n![CI](https://github.com/SamVerschueren/expiry-map/workflows/CI/badge.svg) [![codedov](https://codecov.io/gh/SamVerschueren/expiry-map/branch/master/graph/badge.svg)](https://codecov.io/gh/SamVerschueren/expiry-map)\n\n> A [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) implementation with expirable items\n\nMemory is automatically released when an item expires by removing it from the `Map`.\n\n\n## Install\n\n```\n$ npm install expiry-map\n```\n\n\n## Usage\n\n```js\nimport ExpiryMap = require('expiry-map');\n\nconst map = new ExpiryMap(1000, [\n\t['unicorn', '🦄']\n]);\n\nmap.get('unicorn');\n//=> 🦄\n\nmap.set('rainbow', '🌈');\n\nconsole.log(map.size);\n//=> 2\n\n// Wait for 1 second...\nmap.get('unicorn');\n//=> undefined\n\nconsole.log(map.size);\n//=> 0\n```\n\n\n## API\n\n### ExpiryMap(maxAge, [iterable])\n\n#### maxAge\n\nType: `number`\n\nMilliseconds until an item in the `Map` expires.\n\n#### iterable\n\nType: `Object`\n\nAn `Array` or other `iterable` object whose elements are key-value pairs.\n\n### Instance\n\nAny of the [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) methods.\n\n\n## Related\n\n- [expiry-set](https://github.com/SamVerschueren/expiry-set) - A `Set` implementation with expirable keys\n- [map-age-cleaner](https://github.com/SamVerschueren/map-age-cleaner) - Automatically cleanup expired items in a Map\n\n\n## License\n\nMIT © [Sam Verschueren](https://github.com/SamVerschueren)\n","publish_time":1534330180416,"_cnpm_publish_time":1534330180416,"dist-tags":{"latest":"2.0.0"}}