@rogerpence/rp-utils
    Preparing search index...

    Function existsFile

    • Checks if a file exists at the specified path.

      Parameters

      • filePath: string

        The path to the file to check

      Returns Promise<boolean>

      A promise that resolves to true if the file exists, false otherwise

      Check if a file exists:

      const exists = await existsFile('path/to/file.txt');
      if (exists) {
      console.log('File found!');
      }

      Use in conditional logic:

      if (await existsFile(errorFilePath)) {
      await fsa.rm(errorFilePath);
      }