Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

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

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

Determine if a path exists (sync).

Examples

From direct import

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

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

From common import

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

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

Parameters

path: string

The path to check for existence.

Returns

boolean

Return true if the path exists.