import { which } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/cli.js";
Returns the path of the given command if it exists in the system,
otherwise returns null
.
This function is available in Windows as well.
Examples
Example 1
Example 1
import { which } from "@ayonli/jsext/cli";
const path = await which("node");
console.log(path);
// e.g. "/usr/bin/node" in UNIX/Linux or "C:\\Program Files\\nodejs\\node.exe" in Windows