lib/extensions.js
function getCachedBinary() {
  var i,
    cachePath,
    cacheBinary,
    cachePathCandidates = getCachePathCandidates(),
    binaryName = getBinaryName();

  for (i = 0; i < cachePathCandidates.length; i++) {
    cachePath = path.join(cachePathCandidates[i], pkg.name, pkg.version);
    cacheBinary = path.join(cachePath, binaryName);

    if (fs.existsSync(cacheBinary)) {
      return cacheBinary;
    }
  }

  return '';
}
function getCachedBinary() {
  var i,
    cachePath,
    cacheBinary,
    cachePathCandidates = getCachePathCandidates(),
    binaryName = getBinaryName();

  for (i = 0; i < cachePathCandidates.length; i++) {
    cachePath = path.join(cachePathCandidates[i], pkg.name, pkg.version);
    cacheBinary = path.join(cachePath, binaryName);

    if (fs.existsSync(cacheBinary)) {
      return cacheBinary;
    }
  }

  return '';
}
function getCachedBinary ( ) { var i , cachePath , cacheBinary , cachePathCandidates = getCachePathCandidates ( ) , binaryName = getBinaryName ( ) ; for ( i = 0 ; i < cachePathCandidates . length ; i ++ ) { cachePath = path . join ( cachePathCandidates [ i ] , pkg . name , pkg . version ) ; cacheBinary = path . join ( cachePath , binaryName ) ; if ( fs . existsSync ( cacheBinary ) ) { return cacheBinary ; } } return '' ; }
The cached binding

Check the candidates directories provided by `getCachePathCandidates()` for
the binding file, if it exists. By treating the candidate directories
as a prioritised list this method is deterministic, assuming no change to the
local environment.

@return {String} path to cached binary
@api public
The cached binding