New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

network-list2

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

network-list2

List all network devices with hostname and vendor

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

network-list2

List all network devices with an hostname and a vendor.

This fork based on https://github.com/suskind/network-list and use only to fix crash bugs when using it in linux OS.

Install

npm install network-list2 --save

Methods:

  • scan(options, callback) - Scan all the network devices. You'll get an array with all the results as an argument of the callback.

  • scanEach(options, callback) - Scan all the network devices. The callback will be executed on each iteration with an object device as argument

How To:

const netList = require('network-list');

netList.scanEach({}, (err, obj) => {
    console.log(obj); // device object
});


netList.scan({}, (err, arr) => {
    console.log(arr); // array with all devices
});


Options

{
    ip: '192.168.1' // optional base ip, by default will be the first 3 octets of IP address
    timeout: <number>, // optional ping timeout
    vendor: <boolean>, // default: true - get device vendor using MAC Address
}

Result: Device Object

{
        ip: '192.168.1.1', // IP address
        alive: false, // true/false - device is alive
        hostname: null, // string - dns reverse hostname
        mac: null, // string - MAC address
        vendor: null, // string - vendor name
        hostnameError: null, // Error message if got error on getting hostname
        macError: null, // Error message if got an error on getting Mac Address
        vendorError: null, // Error message if got an error on getting vendor name
}

Keywords

network

FAQs

Package last updated on 08 Feb 2019

Related posts