index.d.ts 504 B

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