Skip to content

SkydiverTyler/get-or-set-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

get-or-set-cache

Args

  1. key Cache key
  • Can be any string
  1. ttl Max cache time
  • In seconds
  • Set this to false to debug the callback function and prevent caching
  1. Callback function
  • Async
  • The return value will be cached

Returns

A promise. The callback function's return value. If the value has already been cached, it will return that. If the value has not been cached, it will run and await the callback function, set the cache, and return the value.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published