es6-timed-map
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

npm version License: MIT TypeScript

Open in Gitpod

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 🎃

This repo participated in hacktoberfest 2020, so thank you for all of those that participated, keep learning, keep building and happy hacktoberfest! 👍

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i es6-timed-map

Weekly Downloads

9

Version

1.0.0

License

MIT

Unpacked Size

20.5 kB

Total Files

5

Last publish

Collaborators

  • bradtaniguchi