Files
est-frame/node_modules/path-exists/index.js
2025-10-22 05:38:27 +00:00

20 lines
298 B
JavaScript
Executable File

import fs, {promises as fsPromises} from 'node:fs';
export async function pathExists(path) {
try {
await fsPromises.access(path);
return true;
} catch {
return false;
}
}
export function pathExistsSync(path) {
try {
fs.accessSync(path);
return true;
} catch {
return false;
}
}