(dir)
| 82 | // node/lib/bin layout as the npm platform package). Returns {command, args} or |
| 83 | // null when the directory doesn't hold a usable bundle yet. |
| 84 | function launcherIn(dir) { |
| 85 | if (isWindows) { |
| 86 | var nodeExe = path.join(dir, 'node.exe'); |
| 87 | var entry = path.join(dir, 'lib', 'dist', 'bin', 'codegraph.js'); |
| 88 | if (fs.existsSync(nodeExe) && fs.existsSync(entry)) { |
| 89 | return { command: nodeExe, args: liftoff(entry) }; |
| 90 | } |
| 91 | } else { |
| 92 | var launcher = path.join(dir, 'bin', 'codegraph'); |
| 93 | if (fs.existsSync(launcher)) return { command: launcher, args: process.argv.slice(2) }; |
| 94 | } |
| 95 | return null; |
| 96 | } |
| 97 | |
| 98 | // --liftoff-only keeps tree-sitter's WASM grammars off V8's turboshaft tier to |
| 99 | // avoid the Zone OOM on Node >= 22 (issues #293/#298). The unix bin/codegraph |
no test coverage detected