Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 567 Bytes

File metadata and controls

29 lines (20 loc) · 567 Bytes

glass

This cache is very simple, and meant to be entirely transparent. It takes variable args and the cache is immutable. :

package.json:

"dependencies" : {
  "cthrough" : "chb0github/cthrough"
}

usage:

Most basic:

const cache = require('cthrough');

const myFunc = cache((someArg) => `{Math.random()} {someArg}`);
myFunc(arg)
const cache = require('cthrough');

const myFunc = cache((secretId) => getFromAws(secretId), (keyId) => // return true on expired key);

myFunc("fooKey");