Skip to content

findCommand

View as Markdown
function findCommand(cmd, o?): Promise<string | null>;

Defined in: node/exe.ts:90

The file a shell would run for cmd, without starting one. POSIX: an executable file in a PATH folder. Windows: every PATH folder in order (quoted entries allowed), trying PATHEXT with .exe first; only names with a PATHEXT extension are found (as CreateProcess would), never an extensionless file. A command containing a path separator must be absolute and is never searched; relative PATH entries (e.g. .) are skipped, so nothing is looked up in the current directory. Null when nothing is found.

Parameter Type
cmd string
o? Omit<ResolveOptions, "execPath">

Promise<string | null>