如何通过多个接口获取 运行 在 windows 上的网络接口的 MAC 地址?

How to get the MAC address of network interface that running on windows with multiple interfaces?

如何使用 Nodejs 获取 windows 上具有多个接口的 运行 网络接口的 MAC 地址?

ipconfig /all 和 getmac 无法得到准确的结果。:(

您可以使用 npm 中的 network 包。

安装:

npm install network

使用:

const network = require('network');

network.get_active_interface(function(err, obj) {
  console.log(obj.mac_address);
})