stylelint
Version:
A mighty CSS linter that helps you avoid errors and enforce conventions.
17 lines (14 loc) • 291 B
JavaScript
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;
}
}