企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
os模块用于与硬件设备通信。 ## Socket通信 下面例子列出当前系列的所有IP地址。 ~~~ var os = require('os'); var interfaces = os.networkInterfaces(); for (item in interfaces) { console.log('Network interface name: ' + item); for (att in interfaces[item]) { var address = interfaces[item][att]; console.log('Family: ' + address.family); console.log('IP Address: ' + address.address); console.log('Is Internal: ' + address.internal); console.log(''); } console.log('=================================='); } ~~~