MCPcopy Create free account
hub / github.com/denoland/std / checkExists

Function checkExists

fs/unstable_remove_test.ts:14–24  ·  view source on GitHub ↗
(path: string | URL)

Source from the content-addressed store, hash-verified

12const isBun = navigator.userAgent.includes("Bun/");
13
14async function checkExists(path: string | URL) {
15 try {
16 const stated = await stat(path);
17 return stated.isDirectory;
18 } catch (e) {
19 if (e instanceof NotFound) {
20 return false;
21 }
22 throw e;
23 }
24}
25
26function checkExistsSync(path: string | URL) {
27 try {

Callers 1

Calls 1

statFunction · 0.90

Tested by

no test coverage detected