resolveCommand
View as Markdownfunction resolveCommand( cmd, args?, o?): Promise< | ResolvedCommand| null>;Defined in: node/exe.ts:246
Finds cmd like findCommand and makes it startable without a shell. POSIX: the file found.
Windows: a .exe/.com directly; an npm .cmd shim becomes its Node + JS target (or its .exe
target); any other .cmd/.bat runs through the absolute cmd.exe (/d /s /c) with every argument
quoted. Null when nothing is found. Throws UnsafeCommandError when a .cmd/.bat cannot be
started safely (no absolute cmd.exe, or an argument with ", %, !, ^ or a line break).
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
cmd |
string |
undefined |
args? |
string[] |
[] |
o? |
ResolveOptions |
{} |
Returns
Section titled “Returns”Promise<
| ResolvedCommand
| null>