Nemo's Parental Misguidance
    Have ideas to improve npm?Join in the discussion! »

    local-devices
    TypeScript icon, indicating that this package has built-in type declarations

    3.1.0 • Public • Published

    Local Devices

    version MIT License js-standard-style All Contributors PRs Welcome

    Build Status Coverage Status Watch on GitHub Star on GitHub

    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.

    Installation

    Npm

    npm install local-devices

    Example

    // 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: '...'
      }
      */
    })
     
    // Find all devices within 192.168.0.1 to 192.168.0.25 range
    find('192.168.0.1-192.168.0.25').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 all devices within /24 subnet range of 192.168.0.x
    find('192.168.0.0/24').then(devices => {
        devices /*
        [
          { name: '?', ip: '192.168.0.10', mac: '...' },
          { name: '...', ip: '192.168.0.50', mac: '...' },
          { name: '...', ip: '192.168.0.155', mac: '...' },
          { name: '...', ip: '192.168.0.211', mac: '...' }
        ]
        */
    })

    Contributions

    • Use npm test to run tests.

    Please feel free to create a PR!

    Contributors

    Thanks goes to these wonderful people (emoji key):

    Dylan Piercey
    Dylan Piercey

    💻 💡 👀 📖 🤔 💬
    Stefan Natter
    Stefan Natter

    💻 ⚠️ 🐛 📖 🤔
    kounelios13
    kounelios13

    🐛 📖
    MarkusSuomi
    MarkusSuomi

    💻
    Xavier Martin
    Xavier Martin

    💻
    howel52
    howel52

    💻 🐛
    LucaSoldi
    LucaSoldi

    💻 🐛
    Miosame
    Miosame

    💻 📖 💡

    This project follows the all-contributors specification. Contributions of any kind are welcome!

    How to add Contributors

    Contributors can be added with the all-contributors cli. The cli is already installed and can be used like this:

    yarn all-contributors add <username> <emoji-keys>

    LICENCE

    MIT

    Install

    npm i local-devices

    DownloadsWeekly Downloads

    681

    Version

    3.1.0

    License

    MIT

    Unpacked Size

    19.2 kB

    Total Files

    9

    Last publish

    Collaborators

    • avatar
    • avatar