MCPcopy Create free account
hub / github.com/node-modules/utility / exists

Function exists

src/fs.ts:8–17  ·  view source on GitHub ↗
(file: string)

Source from the content-addressed store, hash-verified

6 * Returns the file stats if it exists, or `false` if it doesn't.
7 */
8export async function exists(file: string): Promise<Stats | false> {
9 try {
10 return await stat(file);
11 } catch (err: any) {
12 if (err.code === 'ENOENT') {
13 return false;
14 }
15 throw err;
16 }
17}

Callers 1

fs.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…