findExecutable
findExecutable(
bin,options?):Promise<string|undefined>
Defined in: find-executable.ts:89
The first runnable file named bin in options.path (default
process.env.PATH), as an absolute path, or undefined.
Directories and files without the exec bit don’t count.
bin must be a bare name — an empty string, ., .. or anything with a
path separator throws a TypeError, as does any filesystem error other
than “not there” / “not permitted”.
On Windows, where there is no exec bit, bin is tried with each PATHEXT
extension unless it already ends in one (see FindExecutableOptions).
Parameters
Section titled “Parameters”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<string | undefined>
Example
Section titled “Example”import { findExecutableSync } from "@theholocron/fs-utils";
// a project-local binary first, then the real PATHconst tsc = findExecutableSync("tsc", { path: join(cwd, "node_modules", ".bin") }) ?? findExecutableSync("tsc");