cache.js is returning the read cache, but the function invoking it is not saving the returned value anywhere (which is OK for me). The problem is the cache must internally assign the read cache to the var cache, not returning it:
function loadCacheData() {
cache = JSON.parse(fs.readFileSync(pathToFile, 'utf8'));
} // loadCacheData
Instead of current:
function loadCacheData() {
return JSON.parse(fs.readFileSync(pathToFile, 'utf8'));
} // loadCacheData
cache.js
is returning the read cache, but the function invoking it is not saving the returned value anywhere (which is OK for me). The problem is the cache must internally assign the read cache to thevar cache
, not returning it:Instead of current: