1.0.4 • Published 3 years ago

cachenow v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Cachenow

cachenow is a package to easily cache any type of data for a specific time. It works like a Map with a specific TTL for each entry.

Install

npm install cachenow

Usage

import CacheNow from 'cachenow';

const animalWeights = new CacheNow<number>(40 * 1000);

animalWeights.set('dog', 50); // Key = Value

animalWeights.get('dog') // returns 50

setTimeout(() => {
  animalWeights.get('dog') // returns null
}, 50 * 1000)

Todo

  • Delete key from cache
  • Add option to save cache in a specific file
    • new CacheNow(5 * 1000, 'storage.json')
1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago