MCPcopy Index your code
hub / github.com/rollup/plugins / fileExists

Function fileExists

packages/node-resolve/src/fs.ts:11–18  ·  view source on GitHub ↗
(filePath: fs.PathLike)

Source from the content-addressed store, hash-verified

9export const stat = promisify(fs.stat);
10
11export async function fileExists(filePath: fs.PathLike) {
12 try {
13 const res = await stat(filePath);
14 return res.isFile();
15 } catch {
16 return false;
17 }
18}
19
20export async function resolveSymlink(path: fs.PathLike) {
21 return (await fileExists(path)) ? realpath(path) : path;

Callers 3

resolveLikeNodeFunction · 0.90
findPackageJsonFunction · 0.90
resolveSymlinkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected