npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

network-local-devices

v2.0.0

Published

Effortlessly discover all connected devices to the local network

Readme

network-local-devices

CI

Purpose

This package was inspired by local-devices, which has not been updated for over 4 years.

Effortlessly discover all connected devices to the local network. This package provides the IP address, MAC address and device name. It includes specific code for each runtime (Bun, Deno, Node) and operating system. This ensures maximum performance by only loading components when necessary.

How it works

This package retrieves all connected devices by pinging all potential IPs on the local network, calculating them based on the default gateway and the current network type, instead of relying on the ARP table (as the package I was inspired by). This allows it to find devices that are not present in the ARP table but are still reachable.

All spawned OS-level commands are available by default on each system and require no additional installation. Specifically:

  • Linux: ping, arp and getent hosts
  • macOS: ping, arp and dig
  • Windows: ping, PowerShell’s Get-NetNeighbor and GetHostEntry

The commands are spawned through the active runtime. Specifically:

  • Bun: Bun.spawn
  • Deno: Deno.Command
  • Node: spawn from child_process

The output of these commands is parsed into JSON (on Windows) or processed using awk and sed (on Linux and macOS), ensuring a consistent key–value structure for all retrieved information.

It is ESM-only and fully written in TypeScript. It is available on JSR and npm.

Works on

The package has been tested and works correctly on the following operating systems and runtimes:

| | Bun | Deno | Node | |-------------|------|------|------| | macOS | ✔ | ✔ | ✔ | | Linux | ✔ | ✔ | ✔ | | Windows | ✔ | ✔ | ✔ |

JSR

For complete installation and usage details with JSR, visit the package page.

From JSR, you can install the package and access documentation for all available methods. It is recommended for use with Bun and Deno, with sources available directly in TypeScript.

npm

Installation:

npm install network-local-devices

Usage example

import { v4LocalDevices } from 'network-local-devices';

(async () => {
  // Get all connected devices to the local network (default timeout is 3 seconds)
  const devices = await v4LocalDevices();
  console.log(devices);
  /*
  [
    { 
      ip: '192.168.1.5',
      mac: '00:1a:2b:3c:4d:5e',
      name: 'my-laptop' 
    },
    { 
      ip: '192.168.1.8',
      mac: '74:d4:35:89:ef:01',
      name: 'my-phone' 
    }
  ]
  */

  // Search with a 5 seconds timeout and include current IP
  const devicesWithCurrentIp = await v4LocalDevices({ timeout: 5, currentIp: true });
  console.log(devicesWithCurrentIp);
  /*
  [
    { 
      ip: '192.168.1.4',
      mac: '3c:22:fb:a1:b2:c3',
      name: 'my-mac' 
    },
    { 
      ip: '192.168.1.5',
      mac: '00:1a:2b:3c:4d:5e',
      name: 'my-laptop' 
    },
    { 
      ip: '192.168.1.8',
      mac: '74:d4:35:89:ef:01',
      name: 'my-phone' 
    }
  ]
  */
})();

Test

Bun:

bun install
bun test test/bun.test.ts

Deno:

deno test test/deno.test.ts --allow-run

Node:

npm install
npm run test

Contribute

I'm happy to welcome any contribution, big or small, feel free to contribute however you prefer! Whether it's code or just suggestions, everything is appreciated. Please use the GitHub Discussions section to share your ideas or ask questions.

License

network-local-devices is MIT licensed.