Relative path entries and commands that contain a directory separator are resolved against this. On Windows, this directory is also searched before PATH.
Empty entries are ignored. Unlike a POSIX shell, an empty entry is not treated as the current directory, since implicitly searching the current directory is a security risk.
pathExt
Type: string
Default: process.env.PATHEXT
The executable file extensions to look for, as a ;-separated string.
Only used on Windows. Corresponds to the PATHEXT environment variable.
CLI
$ npx which-command --help Usage $ which-command <command> … Options --all, -a List all matching paths, not just the first --silent, -s Suppress output; the exit code still reflects whether all commands were found Examples $ which-command node /usr/local/bin/node $ which-command --all node /usr/local/bin/node /opt/homebrew/bin/node Exits with