mac.js 361 B

1234567891011121314
  1. var npm = require('getmac');//获取mac地址
  2. var fs = require('fs');//获取mac地址
  3. var macAddressStr = "";
  4. //获取机器mac地址
  5. npm.getMac(function(err,macAddress){
  6. if (err) throw err;
  7. macAddressStr = macAddress; //获取mac地址
  8. console.log(macAddressStr);
  9. });
  10. console.info(macAddressStr);
  11. fs.mkdirSync("/Users/john/Desktop/zxg/zxg1");