A simple ping implement by zig.
Note: This is an experiential project, if you want a stable version, please use
@ohos-rs/ping.
import { ping } from "@ohos-rs/zig-ping";
const handlePing = async () => {
const ret = await ping("www.baidu.com");
console.log(ret);
};Previously, we had a fully functional ping tool built using ohos-rs.However, its release build size exceeded 900KB which is quite large for such a lightweight utility.
By re-implementing the same functionality in Zig, we successfully reduced the release build size to just 35KB—over four times smaller than the original version.