Skip to content

Scan local network and find available devices with this light weight NodeJS library.

Notifications You must be signed in to change notification settings

yagizhanNY/node-network-scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Scan local network and find available devices with this light weight NodeJS library.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published