code: async function fileExists(path) {
    try {
      const stats = await stat(path);
      return stats.isFile() ? true : false;
    } catch (err) {
      return false;
    }
  }
docs: Check if a file exists
  @param path {string} - Path to the file to check