New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

device-discovery

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

device-discovery

Discover devices on your local network.

  • 0.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

device-discovery

Discover devices on your local network.

Installation

npm install device-discovery

Quickstart


const discovery = require('device-discovery')
    ({ type: 'ICMP', iface: 'WiFi' })

discovery.on('device', console.log)
    // => 192.168.0.20
    //    192.168.0.31
    //    ...

discovery.on('done', () =>
    console.log('Done!'))

API

require('device-discovery')(options)

  • options <Object>
    • type <String>: default = ICMP; the protocol used for device discovery, one of ICMP or TCP
    • iface <String>: default = WiFi; the interface on which to scan for devices
    • start <Number>: default = 2; the start of the range of hosts to be scanned
    • end <Number>: default = 254; the end of the range of hosts to be scanned
    • port <Number>: default = 1; the port to be scanned (TCP only)
    • timeout <Number>: default = 3000; the timeout after which the scan of a host will be considered a miss
    • retries <Number>: default = 0; the number of retries for pinging a host (ICMP only)
    • excludeSelf <Boolean>: default = true; whether to exclude the device the discovery is run on
  • throws an <Error> if the interface cannot be found or the type is unknown
  • returns an <EventEmitter> with the following events:
    • device => <String>: the IPv4 address of the device found
    • done => (): if the discovery is done

License

WTFPL – Do What the F*ck You Want to Public License.

Made with :heart: by @MarkTiedemann.

Keywords

FAQs

Package last updated on 27 Jun 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc