@arcanewizards/net-utils
v0.1.3
Published
[](https://www.npmjs.com/package/@arcanewizards/net-utils)
Readme
@arcanewizards/net-utils
Small Node.js networking helpers shared by the Arcane Wizards packages.
The package currently focuses on IPv4 interface discovery and common connection-status types used by higher-level transport packages such as @arcanewizards/artnet and @arcanewizards/tcnet.
Installation
pnpm add @arcanewizards/net-utilsRequirements
- Node.js
>=22.12.0 || >=23.1.0
Exports
getNetworkInterfaces()Returns a map of IPv4 interfaces keyed by interface name.ConnectionConfigShared target shape for host-based and interface-based network configuration.NetworkInterfaceDescribes a resolved IPv4 interface, including its broadcast address.NetworkPortStatusDescribes runtime status for a network port or range.
Usage
import { getNetworkInterfaces } from '@arcanewizards/net-utils';
const interfaces = await getNetworkInterfaces();
for (const [name, iface] of Object.entries(interfaces)) {
console.log(name, iface.address, iface.broadcastAddress);
}Return Shape
Each entry returned by getNetworkInterfaces() includes:
nameaddressinternalbroadcastAddress
Only IPv4 addresses are included.
