# local-device-finder

> Given an ip on your local network, find a device based on a given function

Latest version **1.0.1** (published 2016-12-24) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install local-device-finder
pnpm add local-device-finder
yarn add local-device-finder
bun add local-device-finder
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2016-12-24 |
| First published | 2016-12-22 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | R. Stephen Guerra |
| Maintainers | rguerra712 |

## Links

- npm: https://www.npmjs.com/package/local-device-finder
- npm.io page: https://npm.io/package/local-device-finder

## Dependencies (1)

- [address](https://npm.io/package/address.md) ^1.0.1

## Recent versions

- 1.0.1 (latest) — 2016-12-24
- 1.0.0 — 2016-12-22

## README

# local-device-finder
Given an ip on your local network, find a device based on a given function

# Usage
1. First install the npm package `npm install local-device-finder`
1. Next pass in a function for which to confirm a local network ip matches the device, and what happens if found
Example:
```
var finder = require('local-device-finder');

var isCorrectIp = function(ip) {
  // Pass in some function (normally a GET) that verifies the ip is what you seek, e.g. validate a port, etc
  return ip === '10.0.0.12'; // Assuming this would be some function to find my current IP
}

var onIpFound = function(ip) {
  console.log('IP Found: ' + ip);
};

var onIpNotFound = function(ip) {
  console.log('IP Not Found: ' + ip);
};

finder.scan(isCorrectIp, '11-13', onIpFound, onIpNotFound);

// Assuming my IP is 10.0.0.12, the below should output:
// IP Not Found: 10.0.0.11
// IP Found: 10.0.0.12
// IP Not Found: 10.0.0.13
```

---
_Source: https://npm.io/package/local-device-finder · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
