blob: 67f0c23279a5c8d33b4f48be78fd5165eca7caa8 [file] [edit]
import { access } from 'node:fs/promises';
/**
* Check if a file or directory exists at the given path.
* @param {string} path
* @returns {Promise<boolean>}
*/
export default async function pathExists(path) {
try {
await access(path);
return true;
} catch {
return false;
}
}