New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

local-network-scan

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

local-network-scan

A lightweight library to quickly scan local network

latest
Source
npmnpm
Version
1.1.3
Version published
Maintainers
1
Created
Source

local-network-scan

A lightweight library to quickly scan local network.

local-network-scan

The library uses arp tool, in case of Linux machine, make sur it's installed on run-time (or install it by apt-get install net-tools).

The library ping all network IP's in parallel to make the scan faster should take ~10 seconds or less.

Install via NPM:


npm install local-network-scan

Examples

import { scanLocalNetwork } from 'local-network-scan';

(async () => {

	// Scan default network, with default option
	const res1 = await scanLocalNetwork();
	console.log(res1); // [{ ip: '192.168.1.1', mac: '11aa22bb33cc' }, { ip: '192.168.1.2', mac: '12ab23bc34cd' }]

	// Scan specific network
	const res2 = await scanLocalNetwork({ localNetwork: '192.168.2' });
	console.log(res2); // [{ ip: '192.168.2.1', mac: '11aa22bb33cc' }, { ip: '192.168.2.2', mac: '12ab23bc34cd' }]

	// Query device vendor (using https://macvendors.com/ API) - OFF by default
	const res3 = await scanLocalNetwork({ queryVendor: true });
	console.log(res3); // [{ ip: '192.168.2.1', mac: '11aa22bb33cc', vendor: 'some vendor' }, { ip: '192.168.2.2', mac: '12ab23bc34cd', vendor: ''  }]
})()

Keywords

network

FAQs

Package last updated on 10 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts