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

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