feat: use psList on windows (~25ms vs ~320ms)

This commit is contained in:
Zamitto 2024-04-23 21:10:15 -03:00 committed by Zamitto
parent 6ab42eee2d
commit ecac6376d7
3 changed files with 10 additions and 16 deletions

View file

@ -1,12 +1,5 @@
import psList from "ps-list";
import { tasklist } from "tasklist";
export const getProcesses = async () => {
if (process.platform === "win32") {
return tasklist().then((tasks) =>
tasks.map((task) => ({ ...task, name: task.imageName }))
);
}
return psList();
};