3 [![Build Status](https://travis-ci.org/SamVerschueren/map-age-cleaner.svg?branch=master)](https://travis-ci.org/SamVerschueren/map-age-cleaner) [![codecov](https://codecov.io/gh/SamVerschueren/map-age-cleaner/badge.svg?branch=master)](https://codecov.io/gh/SamVerschueren/map-age-cleaner?branch=master)
5 > Automatically cleanup expired items in a Map
11 $ npm install map-age-cleaner
18 import mapAgeCleaner from 'map-age-cleaner';
21 ['unicorn', {data: '🦄', maxAge: Date.now() + 1000}]
29 // Wait for 1 second...
35 > **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`.
40 ### mapAgeCleaner(map, [property])
42 Returns the `Map` instance.
48 Map instance which should be cleaned up.
55 Name of the property which olds the expiry timestamp.
60 - [expiry-map](https://github.com/SamVerschueren/expiry-map) - A `Map` implementation with expirable items
61 - [expiry-set](https://github.com/SamVerschueren/expiry-set) - A `Set` implementation with expirable keys
62 - [mem](https://github.com/sindresorhus/mem) - Memoize functions
67 MIT © [Sam Verschueren](https://github.com/SamVerschueren)