1.1.1 • Published 3 years ago

@cityssm/map-expire v1.1.1

Weekly downloads
19
License
MIT
Repository
github
Last release
3 years ago

map-expire

npm Codacy Badge Maintainability Test Coverage AppVeyor Snyk Vulnerabilities for GitHub Repo

A JavaScript map with entries that expire after a given number of milliseconds.

Based on the work in cavitkeskin/map-expire.

Installation

npm install @cityssm/map-expire

Usage

import { Cache } from "@cityssm/map-expire";
const cache = new Cache();

cache.set(key, value, expiryMillis);

const value = cache.get(key);

Methods

set(key, value, expiryMillis)

  • If expiryMillis is falsy or not given, the value will never be expired.

get(key)

  • Returns undefined if not exists or expired.
1.1.1

3 years ago

1.1.0

3 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago