Checks if a file exists at the specified path.
The path to the file to check
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!');} Copy
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);} Copy
if (await existsFile(errorFilePath)) { await fsa.rm(errorFilePath);}
Checks if a file exists at the specified path.