README
net-scanner
Tested in Mac OSX 10.9.5, Ubuntu 14, Ubuntu 15, Ubuntu 16, Odroid and Raspbian GNU/Linux 7.
Getting Started
arp
if it is not already installed:
First you need to install In Mac you can use brew:
brew install net-scanner
On Debian:
sudo apt-get install net-scanner
net-scanner
module:
Now Install the npm install net-scanner
To use the module programmatically:
/**
* @project net-scanner
* @name example
* @author Pawan Pawar
* @date 16/11/18 - 4:31 PM
* @description
*
*/
'use strict';
var scan = require('./arp');
const console = new (require('my-console')).Console();
scan(function (err, data) {
if (err)
console.error(err);
console.log(JSON.stringify(data));
});
Run Example
$node example.js
[Fri Nov 16 2018 19:59:54][example.js(17)] [LOG] [
{
"ip": "19.18.17.4",
"mac": "02:42:AC:11:00:04",
"interface": "docker0",
"timestamp": 1542378893923
},
{
"ip": "192.168.43.44",
"mac": "BA:58:F4:EF:AF:C5",
"interface": "eth0",
"timestamp": 1542378893923
},
{
"ip": "19.18.17.3",
"mac": "02:42:AC:11:00:03",
"interface": "docker0",
"timestamp": 1542378893923
},
{
"ip": "192.168.43.47",
"mac": "32:1F:7D:AF:FB:3A",
"interface": "eth0",
"timestamp": 1542378893923
},
{
"ip": "192.168.43.61",
"mac": "6E:A6:3A:1B:81:11",
"interface": "eth0",
"timestamp": 1542378893923
},
{
"ip": "192.168.43.1",
"mac": "00:26:F2:FD:BF:7C",
"interface": "eth0",
"timestamp": 1542378893923
},
{
"ip": "rrcs-76-80-1-34.west.bi",
"mac": "00:26:F2:FD:BF:7C",
"interface": "eth0",
"timestamp": 1542378893923
},
{
"ip": "19.18.17.7",
"mac": "02:42:AC:11:00:07",
"interface": "docker0",
"timestamp": 1542378893923
},
{
"ip": "19.18.17.2",
"mac": "02:42:AC:11:00:02",
"interface": "docker0",
"timestamp": 1542378893923
},
{
"ip": "192.168.43.46",
"mac": "E4:E0:A6:05:1D:3A",
"interface": "eth0",
"timestamp": 1542378893923
},
{
"ip": "192.168.43.60",
"mac": "76:CF:05:E4:EC:69",
"interface": "eth0",
"timestamp": 1542378893923
},
{
"ip": "192.168.43.59",
"mac": "0E:87:D1:EC:F9:D3",
"interface": "eth0",
"timestamp": 1542378893923
},
{
"ip": "192.168.43.50",
"mac": "00:50:43:21:E5:C6",
"interface": "eth0",
"timestamp": 1542378893923
},
{
"ip": "19.18.17.6",
"mac": "02:42:AC:11:00:06",
"interface": "docker0",
"timestamp": 1542378893923
},
{
"ip": "19.18.17.8",
"mac": "02:42:AC:11:00:08",
"interface": "docker0",
"timestamp": 1542378893923
},
{
"ip": "192.168.43.54",
"mac": "42:C6:33:10:ED:85",
"interface": "eth0",
"timestamp": 1542378893923
},
{
"ip": "192.168.43.3",
"mac": "8C:85:90:C9:6A:29",
"interface": "eth0",
"timestamp": 1542378893923
},
{
"ip": "19.18.17.5",
"mac": "02:42:AC:11:00:05",
"interface": "docker0",
"timestamp": 1542378893923
},
{
"ip": "192.168.43.62",
"mac": "E6:7E:09:56:D0:D6",
"interface": "eth0",
"timestamp": 1542378893923
}
]