index.d.ts 429 B

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