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 🙏

© 2025 – Pkg Stats / Ryan Hefner

expo-gbping

v0.3.0

Published

Expo module wrapper for GBPing Cocoapod

Readme

expo-gbping

Expo module wrapper for GBPing Swift Library

TL;DR: This module allows you to ping hosts and get accurate round-trip timing results.

🍎 iOS only.

Installation

npx expo install expo-gbping

Configure for iOS

Run npx pod-install after installing the npm package.

API

ping(host: string, timeout?: number): Promise<number>

Pings the specified host and returns the round-trip time in milliseconds. Parameters:

  • host (string) - The host to ping.
  • timeout (number) - The maximum time to wait for a response in milliseconds (optional, default is 1000).

startPinging(options: PingingOptions): void

Starts pinging the specified host (or broadcast range) and emits events for each ping result. Parameters:

  • options (PingOptions) - The options for pinging.
    • url (string) - The host to ping.
    • timeout (number) - The maximum time to wait for a response in milliseconds (optional, default is 1000).
    • interval (number) - The interval between pings in milliseconds (optional, default is 1000).
    • onPing (function) - A callback function that is called with the ping result.
      • event (result: PingResult) => void- The ping event.
        • event.event (string) - The event type ("pingTimeoutManuallyTriggered", "pingReceived", "pingTimeout", "pingFailed", "pingSendFailed").
        • event.sequenceNumber (number) - The sequence number of the ping.
        • event.payloadSize (number) - The size of the payload in bytes.
        • event.ttl (number) - The time-to-live value of the ping.
        • event.host (string) - The host that responded to the ping.
        • event.sendDate (string) - ISO8601 formatted date string of when the ping was sent.
        • event.receiveDate (string) - ISO8601 formatted date string of when the ping was received.
        • event.status (number) - The status code of the ping (0 - 'Pending', 1 - 'Success', 2 - 'Fail').
        • event.rtt (number) - The round-trip time in milliseconds.
        • event.error (string) - The error message if the ping failed.

Usage

import GBPing from 'expo-gbping';

const result: number = await GBPing.ping('https://google.com', 1000);


GBPing.startPinging({
  url: "192.168.1.255",
  timeout: timeout,
  interval: 1000,
  onPing: (event) => {
    console.log(JSON.stringify(event, null, 2));
    if (event.event === 'pingReceived') {
      setResult((prev) => `${prev}\n✅ ${event.sequenceNumber}. ${event.host}: ${event.rtt?.toFixed(2)}ms `);
    } else {
      setResult((prev => `${prev}\n❌ ${event.error}`));
    }
  },
});

GBPing.stopPinging();