es6-timed-map
v1.0.0
Published
An es6-map-like utility class with time based functions and support
Downloads
6
Readme
es6-timed-map
An es6-map-like utility class with time based functions and support
Summary
This class provides a similar interface as the es6 Map, however this also provides "timed" based functionality to automatically remove older entries.
Installation
This library is available on npm:
npm install es6-timed-map
Usage
Here is a basic example of using this library (more examples will be on the way)
const TimedMap = require('es6-timed-map');
const timedMap = new TimedMap();
timedMap.set('firstKey', 'first-value', 100); // save for 100ms
timedMap.set('secondKey', 'second-value', 300); // save for 300ms
// wait for 100ms
console.log(timedMap.get('firstKey')); // undefined
console.log(timedMap.get('secondKey')); // 'second-value'
Contributing
See CONTRIBUTING and review the CODE_OF_CONDUCT.
Reference
See the typedocs based doc site: https://bradtaniguchi.dev/es6-timed-map
Security
See SECURITY
Hacktoberfest 2020 :jack_o_lantern:
This repo participated in hacktoberfest 2020, so thank you for all of those that participated, keep learning, keep building and happy hacktoberfest! :+1: