1.1.0 • Published 6 years ago

subnet-discover v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

subnet-discover

subnet-discover is a nodejs class that allows you to discover of specific devices in your local network. It's just an extension of a ping-subnet package. It has the same API with a small addition. At this moment it supports the only printers.

Installation

npm install subnet-discover

Usage

You can specify the custom ranges parameter

Ranges parameter is represented by array of strings. There are two possible forms: just a single IP or the range.

const SubnetDiscoverer = require('subnet-discover');

const ranges = [
  '192.168.0.123',
  '192.168.0.1-192.168.0.100'
];

const subnetDiscoverer = new SubnetDiscoverer(ranges);

subnetDiscoverer.on('host:printer', (ip, deviceName) => {
  console.log('printer', ip, deviceName);
});

subnetDiscoverer.discover();

If the custom ranges is not specified it would be assigned using current network settings

const SubnetDiscoverer = require('subnet-discover');

const subnetDiscoverer = new SubnetDiscoverer();

subnetDiscoverer.on('host:printer', (ip, deviceName) => {
  console.log('printer', ip, deviceName);
});

subnetDiscoverer.discover();

Events list

NameArgsDescription
host:aliveIP-address of a live hostFired when the ping of any host is succesful
ping:endemptyFired when the ping of all IPs in ranges is completed
host:printerIP-address and the model of the printerFired when printer is detected
1.1.0

6 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago