{"name":"expiry-map","version":"1.0.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"},"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":"542361d9ec1e972497083d30e00998a0978a502f","bugs":{"url":"https://github.com/SamVerschueren/expiry-map/issues"},"homepage":"https://github.com/SamVerschueren/expiry-map#readme","_id":"expiry-map@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"samverschueren","email":"sam.verschueren@gmail.com"},"dist":{"integrity":"sha512-a/QtQMu6CFP74tVNoLV3XarBsL+GqQPcKOup9uukvyz13F3ZW4SPBxbGOrMMqpq6rFFW+T+dzd5VMPDntlLbXA==","shasum":"7126e5151a9788747c849492737a9186ff07dda7","tarball":"http://registry-npm.ywwl.com/expiry-map/download/expiry-map-1.0.0.tgz","fileCount":5,"unpackedSize":6265,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbcrTeCRA9TVsSAnZWagAAGLgP+wTxPRCMVLTwzXDzkKtB\ns1GvLH1EWJcIjYKYJ7NWzD7r+HeYdk/oSHHH23zjDf0sAYgZHh+hmprikYPU\n1IZwgwmrMF3kg49JQ1BsoVgeLxWOpr9TZrMLhCt91wJNlGLubEc1+wrw02Yg\npQ4+BYwQdMUxISU34GHLLQhcmmcrmunld31Td9fw12AfA7CqQIFRktFVbqAS\n9rgztnzlYw4Rqz2GbJWg2w0QGTpSVpqMqYzXmOzZBoVwx6jXdo+OKYJan1uo\nZJ0nwLXxgckGkwH16wd949MVtmge1TrykqAV1PC5wlMQwOpzamEM2SVnqdGR\nTZh9q23ajZqxTgAXhvN6EuSAVogpHIddQpF/6Oyg9n6RgpxDJIO8ERPUJiRm\nIyn7F82QTgkBoReZU+7OqQwpggZS+Ins1q8tlG94PxHfOJgB8xiVqGyXjb40\nVL8LrHfBM8YE9D5pYNZoBJCKFmYZQYleMMPjWktlAXvL5x1O1XzCvdwnBGZO\nqnMRwMvXe6Zb+jad7nVEr9Uwpu9xoTsydEVnZoo7mu2XwmAB+qhg03IgDA9f\nTgPZKmR9i+tcKiFkprRPwgBBnUVL9xxv38ZkHPRqdlwnLDmlr8BjO93PZRzA\nO+aWKb4KefAwOTiy5kRaKYjyzi+bXdMAwW5AiGxFwASK7QGVb4OS0aa5FRK4\njHcm\r\n=Fk5Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGOevwwBrfUPEq0YPkKA9x2NU/WW3f0WP3bQb3n3seiVAiEAkmVOHlS4372BTwflQ7FbPiIiYy51GZXatPSCpg4obQA="}],"size":2736,"noattachment":false,"key":"/expiry-map/-/expiry-map-1.0.0.tgz"},"maintainers":[{"name":"samverschueren","email":"sam.verschueren@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/expiry-map_1.0.0_1534244061626_0.46024323193988237"},"_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":1534244061713,"_cnpm_publish_time":1534244061713,"dist-tags":{"latest":"2.0.0"}}