Gathering detailed insights and metrics for tauri-plugin-network-api
Gathering detailed insights and metrics for tauri-plugin-network-api
Gathering detailed insights and metrics for tauri-plugin-network-api
Gathering detailed insights and metrics for tauri-plugin-network-api
npm install tauri-plugin-network-api
Typescript
Module System
Node Version
NPM Version
72.5
Supply Chain
98.9
Quality
80
Maintenance
100
Vulnerability
99.6
License
Rust (85.67%)
TypeScript (12.13%)
JavaScript (2.2%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
39 Stars
24 Commits
1 Forks
1 Watchers
5 Branches
2 Contributors
Updated on Jun 24, 2025
Minified
Minified + Gzipped
Latest Version
2.0.5
Package Id
tauri-plugin-network-api@2.0.5
Unpacked Size
31.42 kB
Size
6.26 kB
File Count
17
NPM Version
10.9.0
Node Version
22.11.0
Published on
Jan 05, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
5
This is a Tauri plugin for reading network interface information and scanning network.
If you are installing from npm and crate.io package registry, make sure the versions for both packages are the same, otherwise, the API may not match.
cargo add tauri-plugin-network
to add the package.
Or add the following to your Cargo.toml
for the latest unpublished version (not recommanded).
1tauri-plugin-network = { git = "https://github.com/HuakunShen/tauri-plugin-network", branch = "main" }
Run the following to install JavaScript/TypeScript API package.
1npm i tauri-plugin-network-api 2# npm add https://github.com/HuakunShen/tauri-plugin-network # 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_network::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 types.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 { getInterfaces, NetworkInterface } from "tauri-plugin-network-api"; 2 3function getInterfacesOnClick() { 4 getInterfaces().then((ifaces: Array<Object>) => { 5 const parsed = z.array(NetworkInterface).safeParse(ifaces); 6 if (parsed.success) { 7 data = JSON.stringify(parsed.data, null, 2); 8 } else { 9 error = parsed.error.toString(); 10 } 11 }); 12}
1import { 2 isHttpPortOpen, 3 isPortTaken, 4 findAvailablePort, 5 scanOnlineIpPortPairs, 6 scanOnlineIpsByPort, 7 nonLocalhostNetworks, 8 localServerIsRunning, 9 scanLocalNetworkOnlineHostsByPort, 10} from "tauri-plugin-network-api"; 11 12console.log(await is_http_port_open("127.0.0.1", 8000)); 13console.log(await isPortTaken(8000)); 14console.log(await findAvailablePort()); 15console.log( 16 await scanOnlineIpPortPairs([ 17 { ip: "127.0.0.1", port: 8000 }, 18 { ip: "192.168.3.6", port: 8000 }, 19 { ip: "192.168.3.5", port: 8000 }, 20 ]) 21); 22console.log( 23 await scanOnlineIpsByPort(["127.0.0.1", "192.168.3.6", "192.168.1.2"], 8000) 24); 25console.log("Non Localhost Networks", await nonLocalhostNetworks()); 26console.log("Local Server is Running", await localServerIsRunning(8000)); 27console.log( 28 "Scan Local Network for service", 29 await scanLocalNetworkOnlineHostsByPort(8000, "AppName") 30);
See SvelteKit Example for an example written with SvelteKit.
No vulnerabilities found.
No security vulnerabilities found.