2025-04-14 13:56:55 +02:00

29 lines
448 B
JavaScript

import os from "os";
import psList from "ps-list";
export class OsService {
constructor() {
this.platform = os.platform();
}
isWindows = () => {
return this.platform === "win32";
};
isDarwin = () => {
return this.platform === "darwin";
};
isLinux = () => {
return this.platform === "linux";
};
getWorkingDir = () => {
return process.cwd();
};
listProcesses = async () => {
await psList();
};
}