holymac
v0.0.3
Published
Get the MAC address of one or many peers on your network.
Downloads
8
Readme
Holymac!
Get the MAC address of one or many peers on your network.
Install
npm install holymac
Example
var holymac = require('holymac');
holymac.all(function(err, list) {
if (err) throw err;
/* list is an array of objects, like:
[ { ip: '192.168.0.2',
mac: '20:AF:78:D9:B1:E6',
interface: 'wlan0' },
{ ... }, { ... } ]
*/
})
Or if you want to get the MAC address of a specific host:
var ip = '10.0.0.123';
holymac.one(ip, function(err, mac) {
if (err) throw err;
console.log(mac); // => 'AA:BB:CC:DD:EE:FF'
})
Credits
Written by Tomás Pollak.
Copyright
(c) Fork Ltd. MIT license.