Download src/services/executables.mjs from xlt99/EmboDi: direct link, hf CLI and curl.
- Browser
- Download file 445 Bytes
-
https://huggingface.co/spaces/xlt99/EmboDi/resolve/main/src/services/executables.mjs
- Command line
-
hf download hf://spaces/xlt99/EmboDi/src/services/executables.mjs
-
curl -L -o executables.mjs https://huggingface.co/spaces/xlt99/EmboDi/resolve/main/src/services/executables.mjs
445 Bytes
| import { existsSync } from "node:fs"; | |
| import { join, delimiter } from "node:path"; | |
| function findExecutable(name) { | |
| for (const path of (process.env.PATH || "").split(delimiter)) { | |
| if (!path) continue; | |
| for (const ext of process.platform === "win32" ? [".exe", ".cmd", ""] : [""]) { | |
| const candidate = join(path, name + ext); | |
| if (existsSync(candidate)) return candidate; | |
| } | |
| } | |
| return null; | |
| } | |
| export { | |
| findExecutable | |
| }; | |