UNPKG

@intlayer/chokidar

Version:

Uses chokidar to scan and build Intlayer declaration files into dictionaries based on Intlayer configuration.

44 lines (42 loc) 1.25 kB
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const require_runtime = require('../../_virtual/_rolldown/runtime.cjs'); let node_child_process = require("node:child_process"); //#region src/utils/runParallel/spawnWin32.ts /** * Kills the new process and its sub processes forcibly. */ const createKillHandler = (child) => { return () => { if (!child.pid) return false; try { (0, node_child_process.spawnSync)("taskkill", [ "/F", "/T", "/PID", String(child.pid) ], { stdio: "ignore" }); } catch {} return true; }; }; /** * Launches a new process with the given command. * This is almost same as `child_process.spawn`. * * This returns a `ChildProcess` instance. * `kill` method of the instance kills the new process and its sub processes forcibly. * * @param command - The command to run. * @param args - List of string arguments. * @param options - Options. * @returns A ChildProcess instance of new process. * @private */ const spawnWin32 = (command, args, options) => { const child = (0, node_child_process.spawn)(command, args, options); child.kill = createKillHandler(child); return child; }; //#endregion exports.spawnWin32 = spawnWin32; //# sourceMappingURL=spawnWin32.cjs.map