Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/fathym_common/src/common/path/exists.ts>exists

The Fathym Reference Architecture provides the common foundation for applications built in Typescript.
Latest
function exists
import { exists } from "https://deno.land/x/fathym_common@v0.2.160/src/common/path/exists.ts";

Determine if a path exists (async).

Examples

From direct import

import { exists } from '@fathym/common/path';

if (await exists('/path/to/file.txt')) {
 console.log('File exists');
}

From common import

import { exists } from '@fathym/common';

if (await exists('/path/to/file.txt')) {
 console.log('File exists');
}

Parameters

path: string

The path to check for existence.

Returns

Promise<boolean>

Return true if the path exists.