Skip to content

arlandantas/simple-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

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

About

JS Runtime cache as simple as possible

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published