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

@bobfrankston/neoping

v0.1.6

Published

Cross-platform low-level ICMP ping - exposes Windows vs Linux differences

Readme

neoping

Cross-platform low-level ICMP ping using native OS APIs via Koffi FFI.

  • Windows: IcmpSendEcho2 (Iphlpapi.dll) — no admin required
  • Linux: socket(AF_INET, SOCK_DGRAM, IPPROTO_ICMP) via libc — unprivileged (kernel 3.0+)

No child_process, no shelling out to ping — pure FFI to the kernel ICMP stack.

Why?

Windows ping works but raw socket ICMP implementations fail. This tool exposes why:

  • Windows XP SP2 neutered Winsock raw sockets — the kernel ICMP driver (icmp.sys) intercepts replies before your socket sees them
  • Windows Firewall blocks inbound ICMP Echo Reply by default
  • The correct Windows path is IcmpSendEcho2, which talks directly to the kernel ICMP driver
  • Linux has no competing ICMP driver and supports unprivileged ICMP dgram sockets since kernel 3.0

API

Primary use is as a library. RTT values are in milliseconds (float, sub-ms precision).

import { ping, getDiagnostics } from "@bobfrankston/neoping";

// Always returns an array corresponding 1:1 to the input
// Uses allSettled — one failure won't block others
const results = await ping("8.8.8.8");
console.log(results[0].stats.avgRtt); // 10.6 (ms)

// Multiple targets in parallel — results[i] corresponds to input[i]
const results = await ping(["8.8.8.8", "1.1.1.1", "google.com"]);

// All options (all optional)
const result = await ping("8.8.8.8", {
    count: 4,       // pings per host (default 4)
    timeout: 4000,  // per-ping timeout in ms (default 4000)
    interval: 1000, // interval between pings in ms (default 1000)
    ttl: 128,       // time-to-live (default 128)
    size: 32,       // payload bytes (default 32)
    sudo: false,    // auto-escalate on Linux if DGRAM fails (default false)
    family: 4,      // 4 or 6 (default 4)
});

// Platform diagnostics
const diag = await getDiagnostics();

PingResult

{
    host: string;          // original target
    address: string;       // resolved IP (empty on error)
    family: number;        // 4 or 6
    replies: PingReply[];  // individual pings
    stats: {
        sent: number;
        received: number;
        lost: number;
        lossPercent: number;
        minRtt: number;    // ms
        maxRtt: number;    // ms
        avgRtt: number;    // ms
    };
    platform: string;
    method: string;        // backend used
    diagnostics: string[];
}

CLI

neoping <host> [host2 ...] [options]

Options:
  -c <n>       Pings per host (default 4)
  -t <ms>      Timeout in ms (default 4000)
  -i <ms>      Interval in ms (default 1000)
  -ttl <n>     TTL (default 128)
  -s <n>       Payload bytes (default 32)
  -sudo        Escalate if unprivileged fails (Linux)
  -json        JSON output
  -diag        Platform diagnostics
$ node . google.com 8.8.8.8 1.1.1.1 -c 3
Host        Address         Min(ms)  Avg(ms)  Max(ms)  Loss
----------  --------------  -------  -------  -------  ----
google.com  142.250.217.14     10.0     11.1     12.3    0%
            8.8.8.8             9.5     10.2     10.8    0%
            1.1.1.1             2.6      3.1      3.5    0%

Caveat

This is a personal project provided as-is with no official support. Unlike most npm ping packages, it uses native OS ICMP APIs and does not shell out to the ping command. Use at your own risk.

Requirements

  • Node.js 24+
  • koffi (native FFI, installed automatically)