lib/cache.js
function (basepath, action, recursive) {
  var isDirectory = function (target) {
    return fs.statSync(target).isDirectory();
  };
  var nextLevel = function (subpath) {
    _.each(fs.readdirSync(path.join(basepath, subpath)), function (filename) {
      if (isDirectory(path.join(basepath, (filename = path.join(subpath, filename))))) {
        if (recursive) {
          nextLevel(filename);
        }
      } else {
        action(filename);
      }
    });
  };
  nextLevel('./');
}
function (basepath, action, recursive) {
  var isDirectory = function (target) {
    return fs.statSync(target).isDirectory();
  };
  var nextLevel = function (subpath) {
    _.each(fs.readdirSync(path.join(basepath, subpath)), function (filename) {
      if (isDirectory(path.join(basepath, (filename = path.join(subpath, filename))))) {
        if (recursive) {
          nextLevel(filename);
        }
      } else {
        action(filename);
      }
    });
  };
  nextLevel('./');
}
function ( basepath , action , recursive ) { var isDirectory = function ( target ) { return fs . statSync ( target ) . isDirectory ( ) ; } ; var nextLevel = function ( subpath ) { _ . each ( fs . readdirSync ( path . join ( basepath , subpath ) ) , function ( filename ) { if ( isDirectory ( path . join ( basepath , ( filename = path . join ( subpath , filename ) ) ) ) ) { if ( recursive ) { nextLevel ( filename ) ; } } else { action ( filename ) ; } } ) ; } ; nextLevel ( './' ) ; }
recursive read each file in directories
recursive read each file in directories