Skip to main content
Deno 2 is finally 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.
Go to Latest
function exists
import { exists } from "https://deno.land/x/fathym_common@v0.2.165-integration/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.