| [](https://travis-ci.org/SamVerschueren/map-age-cleaner) [](https://codecov.io/gh/SamVerschueren/map-age-cleaner?branch=master) |
| > Automatically cleanup expired items in a Map |
| $ npm install map-age-cleaner |
| import mapAgeCleaner from 'map-age-cleaner'; |
| ['unicorn', {data: '🦄', maxAge: Date.now() + 1000}] |
| > **Note**: Items have to be ordered ascending based on the expiry property. This means that the item which will be expired first, should be in the first position of the `Map`. |
| ### mapAgeCleaner(map, [property]) |
| Returns the `Map` instance. |
| Map instance which should be cleaned up. |
| Name of the property which olds the expiry timestamp. |
| - [expiry-map](https://github.com/SamVerschueren/expiry-map) - A `Map` implementation with expirable items |
| - [expiry-set](https://github.com/SamVerschueren/expiry-set) - A `Set` implementation with expirable keys |
| - [mem](https://github.com/sindresorhus/mem) - Memoize functions |
| MIT © [Sam Verschueren](https://github.com/SamVerschueren) |