Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: v0.1
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (21 sloc) 0.719 kb

macaddr.js

Gets the MAC addresses for the current machine.

Comes in two forms, one to get the first address found, and one to get them all.

var macaddr = require('macaddr');

macaddr.address()

macaddr.address(function(err, addr) {
    if (addr) {
        console.log('MAC address: ' + addr);
    } else {
        console.log('MAC address not found');
    }
});

macaddr.all_addresses()

macaddr.all_addresses(function(err, addrs) {
    if (addrs && addrs.length > 0) {
        console.log('MAC addresses: ' + JSON.stringify(addrs));
    } else {
        console.log('No MAC addresses found');
    }
});
Jump to Line
Something went wrong with that request. Please try again.