MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / whichNodeSync

Function whichNodeSync

src/utils/which.ts:33–56  ·  view source on GitHub ↗
(command: string)

Source from the content-addressed store, hash-verified

31}
32
33function whichNodeSync(command: string): string | null {
34 if (process.platform === 'win32') {
35 try {
36 const result = execSync_DEPRECATED(`where.exe ${command}`, {
37 encoding: 'utf-8',
38 stdio: ['ignore', 'pipe', 'ignore'],
39 })
40 const output = result.toString().trim()
41 return output.split(/\r?\n/)[0] || null
42 } catch {
43 return null
44 }
45 }
46
47 try {
48 const result = execSync_DEPRECATED(`which ${command}`, {
49 encoding: 'utf-8',
50 stdio: ['ignore', 'pipe', 'ignore'],
51 })
52 return result.toString().trim() || null
53 } catch {
54 return null
55 }
56}
57
58const bunWhich =
59 typeof Bun !== 'undefined' && typeof Bun.which === 'function'

Callers

nothing calls this directly

Calls 2

execSync_DEPRECATEDFunction · 0.85
toStringMethod · 0.65

Tested by

no test coverage detected