false
if the
filepath does not exist or is a directory.
await isFile(filepath)
if (await isFile('./package.json')) {
console.info('File exists');
}
This follows symlinks, so if filepath
is a link to a file, it will return
true
. If filepath
is a link to a directory, it will return false
.