How to use the cacache.clearMemoized function in cacache

To help you get started, we’ve selected a few cacache examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github npm / make-fetch-happen / test / util / test-dir.js View on Github external
function reset (testDir) {
  cacache.clearMemoized()
  process.chdir(__dirname)
  return BB.fromNode(cb => {
    rimraf(testDir, function (err) {
      if (err) { return cb(err) }
      mkdirp(testDir, function (err) {
        if (err) { return cb(err) }
        process.chdir(testDir)
        cb()
      })
    })
  })
}
github npm / make-fetch-happen / test / util / benchttp.js View on Github external
function _cachedFetchLoop (n) {
  cacache.clearMemoized()
  return niceFetch(URL, {
    cacheManager: CACHE
  }).then(res => res.json()).then(res => {
    if (n > 0) {
      return _cachedFetchLoop(n - 1)
    }
  })
}