This repository has been archived on 2026-03-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files

28 lines
814 B
JavaScript

import os from "os";
import { getPlatform } from "./getPlatform.js";
import { getLinuxDistroInfo } from "./getLinuxDistroInfo.js";
export async function getPlatformInfo() {
const currentPlatform = getPlatform();
if (currentPlatform === "mac")
return {
name: "macOS",
version: os.release()
};
else if (currentPlatform === "linux") {
const linuxDistroInfo = await getLinuxDistroInfo();
return {
name: linuxDistroInfo.name,
version: linuxDistroInfo.version
};
}
else if (currentPlatform === "win")
return {
name: "Windows",
version: os.release()
};
return {
name: "Unknown",
version: os.release()
};
}
//# sourceMappingURL=getPlatformInfo.js.map