import { ExecOption } from "../typings/exec"; import execExe from "./execExe"; const nodePath = process.platform === "win32" ? `"${process.execPath}"` : process.execPath; const tsNodePath = "ts-node"; export default function execNode(args: string[], options?: ExecOption) { if (args[0].endsWith(".ts")) { return execExe([tsNodePath, ...args], options); } else { return execExe([nodePath, ...args], options); } }