"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.logSystemLogoAndInfo = exports.getSystemInfo = void 0; const os_1 = require("os"); const string_colorizer_1 = require("string-colorizer"); const systeminformation_1 = require("systeminformation"); async function getSystemInfo() { const data = await (0, systeminformation_1.osInfo)(); return { os: data.distro, version: data.release, arch: data.arch, platform: data.platform, totalram: `${Math.round((0, os_1.totalmem)() / 1024 / 1024 / 1024)}GB`, freeram: `${Math.round((0, os_1.freemem)() / 1024 / 1024 / 1024)}GB`, }; } exports.getSystemInfo = getSystemInfo; async function logSystemLogoAndInfo() { const colorizer = new string_colorizer_1.default(); colorizer.addCustomHexColor("macos", false, "#6289d5"); colorizer.addCustomHexColor("macos2", false, "#c4cdf0"); let c4 = colorizer.ansiCodes.foreground.red; let c3 = colorizer.ansiCodes.foreground.green; let c1 = colorizer.ansiCodes.foreground.cyan; let c5 = colorizer.ansiCodes.foreground.yellow; let c2 = colorizer.ansiCodes.foreground.white; await (0, systeminformation_1.osInfo)() .then((data) => { if (data.platform == "Windows") console.log(` ⠀⠀⠀${c4} ⣤⣴⣾⣿⣿⣿⣿⣿⣶⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀${c3}⣠⡄${c2} ⠀⠀${c4} ⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀${c3}⢰⣦⣄⣀⣀⣠⣴⣾⣿⠃${c2} ${colorizer.foregroundColors.cyan("OS:")} ${data.distro} ⠀⠀${c4} ⢸⣿⣿⣿⣿⣿⣿⣿⣿⡏⠀⠀${c3}⣼⣿⣿⣿⣿⣿⣿⣿⣿${c2}⠀ ${colorizer.foregroundColors.cyan("Version:")} ${data.release} ⠀⠀${c4} ⣼⣿⡿⠿⠛⠻⠿⣿⣿⡇⠀⠀${c3}⣿⣿⣿⣿⣿⣿⣿⣿⡿${c2}⠀ ${colorizer.foregroundColors.cyan("Arch:")} ${data.arch} ⠀⠀${c4} ⠉⠀⠀⠀ ⠀⠀⠀⠈⠁⠀${c3}⢰⣿⣿⣿⣿⣿⣿⣿⣿⠇${c2} ${colorizer.foregroundColors.cyan("Platform:")} ${data.platform} ⠀⠀${c1}⣠⣴⣶⣿⣿⣿⣷⣶⣤⠀⠀⠀${c3}⠈⠉⠛⠛⠛⠉⠉${c2}⠀⠀⠀ ${colorizer.foregroundColors.cyan("Computer:")} ${data.hostname} ⠀${c1}⢸⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀${c5}⣶⣦⣄⣀⣀⣀⣤⣤⣶${c2}⠀⠀⠀⠀ ${colorizer.foregroundColors.cyan("Used Ram:")} ${`${Math.round((100 * ((0, os_1.totalmem)() - (0, os_1.freemem)())) / (0, os_1.totalmem)())}%`} ⠀${c1}⣾⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀${c5}⢀⣿⣿⣿⣿⣿⣿⣿⣿⡟${c2}⠀⠀ ⠀${c1}⣿⣿⣿⣿⣿⣿⣿⣿⣿⠁⠀${c5}⢸⣿⣿⣿⣿⣿⣿⣿⣿⡇${c2}⠀⠀ ${c1}⢠⣿⡿⠿⠛⠉⠉⠉⠛⠿⠀⠀${c5}⢸⣿⣿⣿⣿⣿⣿⣿⣿⠁${c2}⠀⠀ ${c1}⠘⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀${c5}⠀⠻⢿⣿⣿⣿⣿⣿⠿⠛${c2}⠀⠀⠀ `, colorizer.ansiCodes.foreground.white); else if (data.platform == "linux") console.log(` ⠀${c4}.---. ${c4}/ \\ ${colorizer.foregroundColors.cyan("OS:")} ${data.distro} ${c4}\\.@-@./ ${colorizer.foregroundColors.cyan("Version:")} ${data.release} ${c4}/\`\\_/\`\\ ${colorizer.foregroundColors.cyan("Arch:")} ${data.arch} ${c4}// _ \\\\ ${colorizer.foregroundColors.cyan("Platform:")} ${data.platform} ${c4}| \ )|_ ${colorizer.foregroundColors.cyan("Computer:")} ${data.hostname} ${c4}/\`\\_\`> <_/ \\ ${colorizer.foregroundColors.cyan("Used Ram:")} ${`${Math.floor((100 * ((0, os_1.totalmem)() - (0, os_1.freemem)())) / (0, os_1.totalmem)())}%`} ${c4} \\__/'---'\\__/ `, colorizer.ansiCodes.foreground.white); else if (data.platform == "darwin") console.log(` ${colorizer.foregroundColors.cyan("OS:")} ${data.distro} ${colorizer.foregroundColors.cyan("Version:")} ${data.release} ${colorizer.foregroundColors.cyan("Arch:")} ${data.arch} ${colorizer.foregroundColors.cyan("Platform:")} ${data.platform} ${colorizer.foregroundColors.cyan("Computer:")} ${data.hostname} ${colorizer.foregroundColors.cyan("Used Ram:")} ${`${Math.floor((100 * ((0, os_1.totalmem)() - (0, os_1.freemem)())) / (0, os_1.totalmem)())}%`} `); }) .catch((error) => { console.error(error); }); console.log(); } exports.logSystemLogoAndInfo = logSystemLogoAndInfo;