Gathering detailed insights and metrics for tauri-plugin-system-info-api
Gathering detailed insights and metrics for tauri-plugin-system-info-api
Gathering detailed insights and metrics for tauri-plugin-system-info-api
Gathering detailed insights and metrics for tauri-plugin-system-info-api
Tauri plugin for obtaining system info (network, memory, cpu, process)
npm install tauri-plugin-system-info-api
Typescript
Module System
Node Version
NPM Version
75.2
Supply Chain
98.9
Quality
81.5
Maintenance
100
Vulnerability
99.6
License
Rust (54.51%)
JavaScript (31.11%)
TypeScript (14.38%)
Total Downloads
28,123
Last Day
13
Last Week
255
Last Month
911
Last Year
25,835
MIT License
47 Stars
63 Commits
7 Forks
1 Watchers
6 Branches
1 Contributors
Updated on Jun 28, 2025
Minified
Minified + Gzipped
Latest Version
2.0.10
Package Id
tauri-plugin-system-info-api@2.0.10
Unpacked Size
60.85 kB
Size
9.44 kB
File Count
14
NPM Version
10.9.2
Node Version
22.14.0
Published on
Mar 18, 2025
Cumulative downloads
Total Downloads
Last Day
-35%
13
Compared to previous day
Last Week
3.7%
255
Compared to previous week
Last Month
-25.9%
911
Compared to previous month
Last Year
1,029.2%
25,835
Compared to previous year
2
5
TypeScript Documentation: https://huakunshen.github.io/tauri-plugin-system-info Rust Documentation: https://docs.rs/crate/tauri-plugin-system-info
This is a Tauri plugin for reading system information.
If you are installing from npm and crates.io package registry, make sure the versions for both packages are the same, otherwise, the API may not match.
For Tauri v1 app, use version 1.x, for Tauri v2 app, use version 2.x. (this applies to both npm and crates.io packages)
cargo add tauri-plugin-system-info
within src-tauri
to add the package.
Or add the following to your Cargo.toml
for the latest unpublished version (not recommanded).
1tauri-plugin-system-info = { git = "https://github.com/HuakunShen/tauri-plugin-system-info", branch = "v1" } # use v2 branch for Tauri v2 plugin
Run the following to install JavaScript/TypeScript API package.
1npm i tauri-plugin-system-info-api 2# npm add https://github.com/HuakunShen/tauri-plugin-system-info # or this for latest unpublished version (not recommended)
In main.rs
, add the following to your tauri::Builder
:
1fn main() { 2 tauri::Builder::default() 3 .plugin(tauri_plugin_system_info::init()) 4 .run(tauri::generate_context!()) 5 .expect("error while running tauri application"); 6}
All TypeScript APIs can be found in api.ts.
Return type of each API is added. The object structures can be found in type.ts.
Valibot was used to define type schema and infer TypeScript types. You can import the types exported from the npm package.
The exported Valibot schemas can be used to parse data and make sure the data returned from rust APIs match the desired structure defined in schema.
1import { 2 allSysInfo, 3 memoryInfo, 4 staticInfo, 5 cpuInfo, 6 AllSystemInfo, 7 StaticInfo, 8 MemoryInfo, 9 CpuInfo, 10 batteries, 11 Batteries, 12} from "tauri-plugin-system-info-api"; 13 14console.log(AllSystemInfo.parse(await allSysInfo())); 15console.log(MemoryInfo.parse(await memoryInfo())); 16console.log(StaticInfo.parse(await staticInfo())); 17console.log(CpuInfo.parse(await cpuInfo())); 18console.log(Batteries.parse(await batteries()));
The API functions in Rust are all exported, so that you can also build your own commands.
Here is a simple example:
1use tauri_plugin_system_info::utils::{SysInfo, SysInfoState}; 2use tauri_plugin_system_info::commands; 3use tauri_plugin_system_info::model::Cpu; 4 5#[tauri::command] 6fn cpu_count() -> Result<usize, String> { 7 let state = SysInfoState::default(); 8 let sysinfo = state.sysinfo.lock().unwrap(); 9 let cpu_count = sysinfo.cpu_count(); 10 Ok(cpu_count) 11}
See https://docs.rs/crate/tauri-plugin-system-info/ for full rust documentation.
SysInfo
is the API struct that can be used to access all information. It's like a wrapper for sysinfo
APIs and other crates. The reason for doing this is, some structs in third party libraries cannot be cloned or serialized, and thus cannot be sent to the frontend.
I aggregate all the APIs, do structure conversion and serilization with custom code.
See SvelteKit Example for an example written with SvelteKit.
No vulnerabilities found.
No security vulnerabilities found.