Skip to main content
Bun.which 是一个用于查找可执行文件绝对路径的实用函数。它类似于类 Unix 系统中的 which 命令。
https://mintcdn.com/ikxin/42j8wRmGt8kDDLLK/icons/typescript.svg?fit=max&auto=format&n=42j8wRmGt8kDDLLK&q=85&s=a2a397cd68603d207db5c5b5d620260afoo.ts
Bun.which("sh"); // => "/bin/sh"
Bun.which("notfound"); // => null
Bun.which("bun"); // => "/home/user/.bun/bin/bun"

完整文档请参见 Docs > API > Utils