#cpu-gpu #cpu #gpu #ram #system-information #hardware #os

system-info-lite

A library for getting system information, including CPU, GPU, RAM, and OS information

2 releases

0.1.1 Jan 2, 2025
0.1.0 Dec 27, 2024

#332 in Unix APIs

Download history 134/week @ 2024-12-26 150/week @ 2025-01-02

284 downloads per month

Apache-2.0

15KB
308 lines

System-info-lite: A library for Getting System Information

In system-info-lite, a group of APIs are defined to get some system information, including CPU, GPU, RAM, and OS information.

Usage

use system_info_lite::{get_system_info, get_cpu_info, get_ram_info, get_os_info};

// Get system information, including CPU, GPU, RAM, and OS information.
let info = get_system_info();
println!("{:#?}", info);

// Get CPU information.
let cpu_info = get_cpu_info();
println!("{:#?}", cpu_info);

// Get RAM information.
let ram_info = get_ram_info();
println!("{:#?}", ram_info);

// Get GPU information.
let gpu_info = get_gpu_info().unwrap();
println!("{:#?}", gpu_info);

// Get OS information.
let os_info = get_os_info();
println!("{:#?}", os_info);

lib.rs:

A library for getting system information, including CPU, GPU, RAM, and OS information.

This library provides a set of APIs to retrieve system information, including CPU, GPU, RAM, and OS information. It supports both macOS and Linux systems.

Usage

use system_info_lite::{get_system_info, get_cpu_info, get_ram_info, get_os_info};
use serde_json::json;

let info = get_system_info().unwrap();
println!("{}", json!(info));

Dependencies

~3–11MB
~127K SLoC