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

Function performKillSequence

interactive.js:222–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220};
221
222const performKillSequence = async processes => {
223 const processList = Array.isArray(processes) ? processes : [processes];
224 const {survivors, hadError} = await attemptKillProcesses(processList);
225
226 if (survivors.length === 0) {
227 return;
228 }
229
230 const suffix = survivors.length > 1 ? 'es' : '';
231 const message = hadError ? `Error killing process${suffix}.` : `Process${suffix} didn't exit in ${DEFAULT_EXIT_TIMEOUT}ms.`;
232 const shouldForceKill = await promptForceKill(survivors, message);
233
234 if (shouldForceKill) {
235 await fkill(processList, {
236 force: true,
237 ignoreCase: true,
238 });
239 }
240};
241
242const findPortsForProcess = (processId, portToPidMap) => {
243 const ports = [];

Callers 1

listProcessesFunction · 0.85

Calls 2

attemptKillProcessesFunction · 0.85
promptForceKillFunction · 0.85

Tested by

no test coverage detected