1.0.9 • Published 1 year ago

node-network-scan v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Node Network Scanner

This library is for scan local network and find available devices.

Installation

npm install node-network-scanner
# or
yarn add node-network-scanner
# or
pnpm add node-network-scanner

Usage

Find all available devices on local network.

const networkScanner = new NetworkScanner();
networkScanner.getAllDevices().then((res) => console.log(res));

Find all available devices on specific network interface by interface address.

const networkScanner = new NetworkScanner();
networkScanner
  .getAllDevicesByFilter({ interfaceAddress: "192.168.1.86" })
  .then((res) => {
    console.log(res);
  });

Find all available devices on specific network interface by interface address and with specific TCP port.

const networkScanner = new NetworkScanner();
networkScanner
  .getAllDevicesByFilter({ interfaceAddress: "192.168.1.86" }, 433)
  .then((res) => {
    console.log(res);
  });

Find all available devices on specific network interface by mac address.

const networkScanner = new NetworkScanner();
networkScanner
  .getAllDevicesByFilter({ mac: "xx-xx-xx-xx-xx-xx" })
  .then((res) => {
    console.log(res);
  });

Output

[
  { "ipAddress": "192.168.1.1", "macAddress": "..." },
  { "ipAddress": "192.168.1.20", "macAddress": "..." },
  { "ipAddress": "192.168.1.21", "macAddress": "..." },
  { "ipAddress": "192.168.1.27", "macAddress": "..." },
  { "ipAddress": "192.168.1.86", "macAddress": "..." },
  { "ipAddress": "192.168.1.136", "macAddress": "..." }
]

Test

npm run test

I am still trying to optimize the performance of pinging devices.

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago