MCPcopy Create free account
hub / github.com/sindresorhus/fkill-cli / attemptKillProcesses

Function attemptKillProcesses

interactive.js:196–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194const DEFAULT_EXIT_TIMEOUT = 3000;
195
196const attemptKillProcesses = async processes => {
197 try {
198 await fkill(processes);
199 const exitStatuses = await Promise.all(processes.map(process_ => processExited(process_, DEFAULT_EXIT_TIMEOUT)));
200 const survivors = processes.filter((_, index) => !exitStatuses[index]);
201 return {survivors, hadError: false};
202 } catch {
203 return {survivors: processes, hadError: true};
204 }
205};
206
207const promptForceKill = async (survivingProcesses, message) => {
208 if (process.stdout.isTTY === false) {

Callers 1

performKillSequenceFunction · 0.85

Calls 1

processExitedFunction · 0.85

Tested by

no test coverage detected