UNPKG

504 BTypeScriptView Raw
1/**
2Check if a path exists.
3
4@returns Whether the path exists.
5
6@example
7```
8// foo.ts
9import {pathExists} from 'path-exists';
10
11console.log(await pathExists('foo.ts'));
12//=> true
13```
14*/
15export function pathExists(path: string): Promise<boolean>;
16
17/**
18Synchronously check if a path exists.
19
20@returns Whether the path exists.
21
22@example
23```
24// foo.ts
25import {pathExistsSync} from 'path-exists';
26
27console.log(pathExistsSync('foo.ts'));
28//=> true
29```
30*/
31export function pathExistsSync(path: string): boolean;