{"name":"expiry-map","version":"1.0.1","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":"1270b620f5893ce860074e64ea11957d58aae3b1","bugs":{"url":"https://github.com/SamVerschueren/expiry-map/issues"},"homepage":"https://github.com/SamVerschueren/expiry-map#readme","_id":"expiry-map@1.0.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"samverschueren","email":"sam.verschueren@gmail.com"},"dist":{"integrity":"sha512-sWlcO8RSQX3IodEP+Md92bPC0GbCx+LaMXOdKd7QAHW/DaJuyHceSadiJ9nuchy4CqYLeesMTuMOP6ntICi6MQ==","shasum":"c5395ee284d57552dec68274da34989861349f7b","tarball":"http://registry-npm.ywwl.com/expiry-map/download/expiry-map-1.0.1.tgz","fileCount":5,"unpackedSize":6290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbctjoCRA9TVsSAnZWagAAyfkP/1OLmH0e6d3jkWkudoBr\noBworjHVUHdKHrmtnQZZYfrN21lFvL3X1FYNFP9jNRVulsrtnfRr59tx81zq\nPFez5LnCsb/0/LQCfOVl0HipUNtBJhkQvsyPYIegrimsVwZz1I0mBd8xyHWi\ni1A71Xw0T/hgjfIQLboK9FNM26Q9zLYrd0KJ/OMMkB1o7BdqBoMAExhFARG5\nGpxoyJmu1GEOiw4kU2QVrSz8HipHc4Am1jeVtm4v4etuKkecZOASmQG8XupU\npk7wApdcWMGt2lKCMN/9D+x5c9r6cLSRRnt0wDHceUzq8GGC4ZTc5ngq1S0p\nKXuOwdfzvbhhZxjpXMZJFZk/TRTLqEwgRc/E+mhwP/SaH+S/FznFgo3ocVNr\nIgEdpR/vKp/lLYMBzpxFUrPB56ZVYUPU0GVQMswP6bskMSQMIcPDdwgDoKs0\nS3hdQVa04VZkFfPO3D1l8c/5ByVH7H088VBN6+zxEnUt0VgbpTvG3LhT2jKW\nGUZJxQUJx5YKb5Kr2BSfYF6nJWvAn7ysmpv0eFWA+1QZabzGLed4n8T1hrky\nBsCdmtjDPIXk57lrnE4xamryt9WKjl/BY6MKikEAxZU7oOD+JJxaled4Byu/\ntzmo6BeDv/MpO605b4iXo9wjTf1r4zYDhhCYcvXJjFJLgYmDquDd7WKEQT/l\nwqcu\r\n=FF39\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBAh9Ih07U1by8EWvRWO7ear8qKhfolHvKbcJInCK9IMAiBlDBfOkAwbMphzKEppjv60dsUcHUPd2qyFl548hDC+kg=="}],"size":2743,"noattachment":false,"key":"/expiry-map/-/expiry-map-1.0.1.tgz"},"maintainers":[{"name":"samverschueren","email":"sam.verschueren@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/expiry-map_1.0.1_1534253288005_0.2864512175135887"},"_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":1534253288058,"_cnpm_publish_time":1534253288058,"dist-tags":{"latest":"2.0.0"}}