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

Function findPortsForProcess

interactive.js:242–252  ·  view source on GitHub ↗
(processId, portToPidMap)

Source from the content-addressed store, hash-verified

240};
241
242const findPortsForProcess = (processId, portToPidMap) => {
243 const ports = [];
244
245 for (const [port, pid] of portToPidMap.entries()) {
246 if (processId === pid) {
247 ports.push(String(port));
248 }
249 }
250
251 return ports;
252};
253
254const listProcesses = async (processes, flags) => {
255 const memoryThreshold = flags.verbose ? 0 : 1;

Callers 1

initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected