mac.js 271 B

12345678910
  1. var npm = require('getmac');//获取mac地址
  2. var macAddressStr = "";
  3. //获取机器mac地址
  4. npm.getMac(function(err,macAddress){
  5. if (err) throw err;
  6. macAddressStr = macAddress; //获取mac地址
  7. console.log(macAddressStr);
  8. });
  9. console.info(macAddressStr);