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

Function listProcesses

interactive.js:254–269  ·  view source on GitHub ↗
(processes, flags)

Source from the content-addressed store, hash-verified

252};
253
254const listProcesses = async (processes, flags) => {
255 const memoryThreshold = flags.verbose ? 0 : 1;
256 const cpuThreshold = flags.verbose ? 0 : 3;
257 const searcher = new FuzzySearch(processes, ['name'], {caseSensitive: false});
258
259 const selectedPid = await search({
260 message: 'Running processes:',
261 pageSize: 10,
262 async source(term = '') {
263 const matchingProcesses = filterAndSortProcesses(processes, term, searcher, flags);
264 return matchingProcesses.map(process_ => renderProcessForDisplay(process_, flags, memoryThreshold, cpuThreshold));
265 },
266 });
267
268 performKillSequence(selectedPid);
269};
270
271const init = async flags => {
272 escExit();

Callers 1

initFunction · 0.85

Calls 1

performKillSequenceFunction · 0.85

Tested by

no test coverage detected