1 | import fs, {promises as fsPromises} from 'node:fs';
|
2 |
|
3 | export async function pathExists(path) {
|
4 | try {
|
5 | await fsPromises.access(path);
|
6 | return true;
|
7 | } catch {
|
8 | return false;
|
9 | }
|
10 | }
|
11 |
|
12 | export function pathExistsSync(path) {
|
13 | try {
|
14 | fs.accessSync(path);
|
15 | return true;
|
16 | } catch {
|
17 | return false;
|
18 | }
|
19 | }
|