@arlandantas/simple-cache

0.0.3 • Public • Published

Simple Cache

The package that give you a runtime cache as simple as possible.

Usage Example

import SimpleCache from '@arlandantas/simple-cache';

// Populates cache
SimpleCache.set('key', 'value');

// Populates cache with an specific TTL (in seconds)
SimpleCache.set('key', 'value', 30);

// Get cache value
SimpleCache.get('key');

// Get cache value with fallback value, that will be returned if the key is not set
SimpleCache.get('key', 'default value');

// Unset cache value
SimpleCache.unset('key');

// Get an object with entire cache key values
SimpleCache.getAllKeyValues();

Installation

# NPM
npm i @arlandantas/simple-cache

# YARN
yarn add @arlandantas/simple-cache

Readme

Keywords

none

Package Sidebar

Install

npm i @arlandantas/simple-cache

Weekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

4.02 kB

Total Files

3

Last publish

Collaborators

  • arlandantas