{"name":"expiry-map","version":"2.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"},"main":"dist/index.js","engines":{"node":">=8"},"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"},"keywords":["map","cache","caching","ttl","expire","expiring","expiry"],"dependencies":{"map-age-cleaner":"^0.2.0"},"devDependencies":{"@types/delay":"^2.0.1","@types/node":"^10.5.8","ava":"^0.25.0","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":"ceb7af2fcd365244cd4f5e4133f7802bf290c685","bugs":{"url":"https://github.com/SamVerschueren/expiry-map/issues"},"homepage":"https://github.com/SamVerschueren/expiry-map#readme","_id":"expiry-map@2.0.0","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-K1I5wJe2fiqjyUZf/xhxwTpaopw3F+19DsO7Oggl20+3SVTXDIevVRJav0aBMfposQdkl2E4+gnuOKd3j2X0sA==","shasum":"b441ee8e8865291ad9a542783076d33bae0f3582","tarball":"http://registry-npm.ywwl.com/expiry-map/download/expiry-map-2.0.0.tgz","fileCount":5,"unpackedSize":6225,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAmVuCRA9TVsSAnZWagAAMYsP/iTIELjANny9CcDo3mE8\n70jf2kL3+DY5h0xNR1TLBHVoleoboKuFh4z0pF7CJcLQyLk/tMg0EHKZ6eH8\nRJWBbKfuV1hpRIStkq0Rxb6wR6HVLPcRvxe5S4Ilf5rl9gvegW5vIm37LXrg\nI24+F56sr6OHt87sOJeS0w+PKDUmSq7jN7+eHqY+T9rsKtmpTAI60fcIuk53\nbSejQPdLzrv/qOffSYLtjQic3glm9Phi90wsaAZGbdHqoEx1ww4iZYLjTWX0\nA3llgRZ7nvyLkE3tHa/MmQWzG2mw9PWQck8IvlhUFgTTjjy/AMNI2Kz00aSN\ngy89LqpBDNT1KDjtoN91Wq50lIozr5FF00bHq3q70td/OLVH1Klq9qcszP30\n3YTGPaZhO1TAq5Gy7xzvflGJh4FqSys8gpBnbq77hO53SCa4OIaXcM1uqR15\nBIB9orxu/E1Pp2l6A2eFQH3g0VlxVyUTxNXAjXXYSA+SXDaUblFNMHXWkIfE\nLW667R8ITjb/mBYbY+oqqgS14JXCXjkxw/CEl3ey7GuK57d5Qo2SOWlqV8x8\nmQ/FgVYcjmtBD9Swe5SOOdYMDGyu1DKDrwMglyKjraniOLhnvshGU9z19TmU\nLD1yxpW5R/v0yuMWC9hWA8tiFoP8m2JX+MovjkNM+MCbuEu47OJHHzWEeWQO\n6PMF\r\n=krxB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC7JmMjFOdBjrYbqjGlr82nvsxLmUWpcC/IPRdBNW7dmAiEAiTyZ5RSqVnbG700VrjK3M7x7CjaY+SNvSoh9FuA8r94="}],"size":2777,"noattachment":false,"key":"/expiry-map/-/expiry-map-2.0.0.tgz"},"_npmUser":{"name":"samverschueren","email":"sam.verschueren@gmail.com"},"directories":{},"maintainers":[{"name":"samverschueren","email":"sam.verschueren@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/expiry-map_2.0.0_1644324206257_0.9893912473096409"},"_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":1644324206400,"_cnpm_publish_time":1644324206400,"dist-tags":{"latest":"2.0.0"}}