UNPKG

aoifetch

Version:

A simple Neofetch style system info tool in Node.js, written entirely by gundalf-cli.

13 lines (9 loc) 770 B
import { execSync } from 'child_process'; import { queryCimProps } from "./lib/win32/cim.js"; import { parseListFormat } from './lib/misc.js'; //console.log(queryCimProps('Win32_Processor', ['Name', 'NumberOfCores', 'MaxClockSpeed', 'CurrentClockSpeed'])); //console.log(queryCimProps('Win32_OperatingSystem', ['Caption', 'Name', 'Manufacturer', 'Version', 'SystemDrive', 'RegisteredUser', 'CSName', 'OSArchitecture'])); //console.log(queryCimProps('Win32_ComputerSystem', ['Name', 'Manufacturer', 'Model', 'SystemFamily', 'SystemType', 'UserName', 'TotalPhysicalMemory'], { verbose: true })); const output = execSync(`whereis apt dpkg pacman rpm 2>/dev/null`, { encoding: 'utf-8' }); const managers = parseListFormat(output, ':'); console.log(managers);