{"name":"expiry-map","version":"1.1.0","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"],"dependencies":{"map-age-cleaner":"^0.1.0"},"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":"3a098dbff2fe0f2dd7a45d184f1f4855fd708bc3","bugs":{"url":"https://github.com/SamVerschueren/expiry-map/issues"},"homepage":"https://github.com/SamVerschueren/expiry-map#readme","_id":"expiry-map@1.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"samverschueren","email":"sam.verschueren@gmail.com"},"dist":{"integrity":"sha512-EviBh1pKXf8TuPIf88HS27Ti2biOZA1Ci4FeWhXzgY/tCBv05FA+7gO0jXt7AF5JgaiReAld1ag3jd5vzvKupw==","shasum":"a625630c32370e60b5866d5315b1ca28f3da2562","tarball":"http://registry-npm.ywwl.com/expiry-map/download/expiry-map-1.1.0.tgz","fileCount":5,"unpackedSize":6598,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbfF3pCRA9TVsSAnZWagAA6w8P/jezx+IjrFh7lZbz9TiC\nhx5AAeVCJoJFRGXRPYOQxYbn4nJYeNGq0m0K5FBIF10CVQ8uYyDX+na++EbJ\n0vAPxoOM5YDTedtcp7T3I04of6P/Td+jlr+GLBi/cp1Jwhr6YrufTAGNoSFi\nXqjVoKXGU4akLviaTd3Y7f/rCMMpauUr7RxAggBqkmjiJuhjtSOrTId5NVYO\nE7TOJmv2y9v4O9DMUUh2aC4s2iV/Ci2biGUnP9RcfozBI6lzCnijhWjibA+p\nniTxCBLL2lRy4RdBlmRRqOXmyUdb1whzPqHbb5e8sCXF/Izd7OtBtWtLwj1u\nyCAbN7+8i4wGxjG/8J42KVMIJjqQ79uFL5Sp+QO67VaC+3E95iV5ppBSWq8i\nnKn26px1w3sU/5zOF8h8RIor9x5lrnMBCXtQW9Q6caJZqJjAPy4o8Kw42IW3\nszpKSOHOEeVPyBBlSFSsWxMUPBylyCnU+z+X4M/caAbZs0vx+mrFyHLvee1Z\ncRQwgUuzoxkFgvcYSeJvb1RhD/vikgejV+pFs4I1tlslr5y0GgI74LoNKJa2\nHtBRe56y3ZnnCLxbzPE6TJkc6o8nsMsJCcZSF7g/ps3NX2GznqV3BeeoXvjI\nhjSWVBmZyGkySkrewxYx/UnysGkDU411AVlIa/iLG+ZlRVtHd7UpF6XOelms\ngWqd\r\n=Vd4k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG8oAAHHF5OcKXlbdO7oxiz7yZ71SEp0feJ1s2lBemV2AiBGyzHDLbNEU8SWWAQBwtyyY9lH0O7IKsrcnsefdXp0Yw=="}],"size":2919,"noattachment":false,"key":"/expiry-map/-/expiry-map-1.1.0.tgz"},"maintainers":[{"name":"samverschueren","email":"sam.verschueren@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/expiry-map_1.1.0_1534877160915_0.33746608705691017"},"_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":1534877160989,"_cnpm_publish_time":1534877160989,"dist-tags":{"latest":"2.0.0"}}