arp-parse
arp-parse is a transform stream that consumes ARP tables and emits JSON representations of their contents.
Install
npm install arp-parse
Output
arp-table | arp-parse >> file.txt
file.txt
--------
{
ip: xxx.xxx.xxx.xxx,
mac: xx:xx:xx:xx:xx:xx || null,
}
{
ip: xxx.xxx.xxx.xxx
mac: xx:xx:xx:xx:xx:xx || null
}
etc.
Example
var arp =var parse =var through =var filter = {return !!devicemac}// Print out the available devices on// the local network (besides our own).arpstdout