node-modules / address

Get current machine IP and MAC address.
Other
233 stars 32 forks source link

Unable to obtain mac address without network connection.Os.networkInterfaces will not return the network card information when there is no network #34

Open HackerWand opened 1 year ago

HackerWand commented 1 year ago
// address.mac
interfaceName = interfaceName || getInterfaceName();
// getInterfaceName
var item = address.interface('IPv4', interfaceName);
var interfaces = os.networkInterfaces();

When there is no network, the network card information will not be returned