0.7.0 • Published 4 years ago

@jurijtokarski/cache v0.7.0

Weekly downloads
10
License
MIT
Repository
github
Last release
4 years ago

In-memory cache class

Install

npm i @jurijtokarski/cache or yarn add @jurijtokarski/cache.

Example

const cache = new Cache();

cache.get("example"); // => { value: null, status: 0 }

cache.set("example", [1, 2, 3], getMinutesInMS(10));

cache.get("example"); // => { value: [1, 2, 3], status: 2 }

// after 10 minutes

cache.get("example"); // => { value: [1, 2, 3], status: 1 }

Statuses

  • 0 means value was not set yet
  • 1 means value was set, but was expired
  • 2 means freash value

Definitions

Feel free to check TypeScript's definitions for package.

0.7.0

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.6.0

4 years ago

0.3.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.6

4 years ago

0.1.3

4 years ago