Find all devices connected to the local network using arp -a
.
This module also pings all possible ip's in the local network to build the arp table.
npm install local-devices
// Using a transpiler
import find from 'local-devices'
// Without using a transpiler
const find = require('local-devices');
// Find all local network devices.
find().then(devices => {
devices /*
[
{ name: '?', ip: '192.168.0.10', mac: '...' },
{ name: '...', ip: '192.168.0.17', mac: '...' },
{ name: '...', ip: '192.168.0.21', mac: '...' },
{ name: '...', ip: '192.168.0.22', mac: '...' }
]
*/
})
// Find a single device by ip address.
find('192.168.0.10').then(device => {
device /*
{
name: '?',
ip: '192.168.0.10',
mac: '...'
}
*/
})
- Use
npm test
to run tests.
Please feel free to create a PR!
Thanks goes to these wonderful people (emoji key):
Dylan Piercey 💬 💻 📖 💡 🤔 👀 |
Stefan Natter 🐛 💻 📖 🤔 |
kounelios13 🐛 📖 |
Markus Suomi 💻 |
Xavier Martin 💻 |
---|
This project follows the all-contributors specification. Contributions of any kind are welcome!