github.com/emc-advanced-dev/unik@v0.0.0-20190717152701-a58d3e8e33b7/containers/compilers/rump/nodejs/node-wrapper/node_modules/macaddress/test.js (about) 1 var macaddress = require('./index'); 2 3 var sync = macaddress.one(function (err, mac) { 4 if (err || !/[a-f0-9]{2}(:[a-f0-9]{2}){5}/.test(mac)) { 5 throw err || mac; 6 } 7 console.log("Mac address for this host: %s", mac); 8 }); 9 console.log("Mac address obtained synchronously: %s", sync); 10 11 macaddress.all(function (err, all) { 12 if (err) { 13 throw err; 14 } 15 console.log(JSON.stringify(all, null, 2)); 16 }); 17 18 console.log(JSON.stringify(macaddress.networkInterfaces(), null, 2));