Skip to content

SonoIo/cache-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cache

Very simple in memory cache for browser and node.js. It provides a very basic ttl implementation.

set(name, value, [ttl])

Store value in the cache with name. ttl sholud be any valid moment duration format. Preferred form is:

var ttl = {
    seconds: 10,
    minutes: 20,
    hours: 1
};

get(name)

Returns the stored cached value. If ttl expires will return null.

remove(name)

Removes related value.

pop(name)

Removes related value and returns the value.

clear()

Clear in memory storage.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •