tiny-filo
Tiny FILO cache for Client or Server
const cache = ;
clear
Method
Clears the contents of the cache
return {Object} FILO instance
Example
cacheclear;
delete
Method
Removes item from cache
param {String} key Item key
return {Object} FILO instance
Example
cache;
evict
Method
Evicts the last item from cache
return {Object} FILO instance
Example
cache;
get
Method
Gets item in cache
param {String} key Item key
return {Mixed} Undefined or Item value
Example
const item = cache;
keys
Method
Returns an Array
of cache item keys.
return {Array} Array of keys
Example
console;
max
Property
Max items to hold in cache (1000)
Example
const cache = ; cachemax; // 500
set
Method
Sets item in cache
param {String} key Item key
param {Mixed} value Item value
return {Object} FILO instance
Example
cache;
size
Property
Number of items in cache
Example
const cache = ; cachesize; // 0 - it's a new cache!
ttl
Property
Milliseconds an item will remain in cache; lazy expiration upon next get()
of an item
Example
const cache = ; cachettl = 3e4;
License
Copyright (c) 2019 Jason Mulligan Licensed under the BSD-3 license.