Skip to content

network

Install the required plugin:

Terminal window
tynd add network
import { network } from "@tynd/plugin-network/client";

Backed by if-addrs — wraps getifaddrs(3) on Unix and GetAdaptersAddresses on Windows. The raw call returns one entry per (interface, IP) pair; the host collapses them so each interface appears once with all its IPs grouped together.

  • network.interfaces(): Promise<NetworkInterface[]> — snapshot of every interface with its assigned IPs.

NetworkInterface:

interface NetworkInterface {
name: string;
ips: string[];
mac: string | null; // null when the host can't read it
is_up: boolean | null; // null when the host can't read it
is_loopback: boolean;
}