code: function exists(filepath) {
    filepath = path.resolve(filepath);
    var res = tryReaddir(filepath);
    if (res === null) {
      return false;
    }
  
    // "filepath" is a directory, an error would be
    // thrown if it doesn't exist. if we're here, it exists
    if (res.path === filepath) {
      return res.path;
    }
  
    // "fp" is not a directory
    var lower = filepath.toLowerCase();
    var len = res.files.length;
    var idx = -1;
  
    while (++idx < len) {
      var fp = path.resolve(res.path, res.files[idx]);
      if (filepath === fp || lower === fp) {
        return fp;
      }
      var fpLower = fp.toLowerCase();
      if (filepath === fpLower || lower === fpLower) {
        return fp;
      }
    }
  
    return false;
  }
docs: Check if the filepath exists by falling back to reading in the entire directory.
  Returns the real filepath (for case sensitive file systems) if found.
  
  @param  {String} `filepath` filepath to check.
  @return {String|Boolean} Returns found filepath if exists, otherwise false.