code: function fileExistsSync(path) {
    if (fs.existsSync) {
      return fs.existsSync(path);
    } else {
      try {
        fs.statSync(path);
        return true;
      } catch (e) {
        return false;
      }
    }
  }
docs: Checks to see if a file exists.
  Compatibility shim for old node.js' that lack fs.existsSync.
  @param {string} path File path.
  @return {boolean} True if the file exists.