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

strike-fw-network-view

v0.1.0

Published

Strike UI for strike-fw-network-check with regional ICE selection

Readme

Strike.js Network View

Strike UI for strike-fw-network-check. Runs a check, shows verdict / progress / axes / accordion details, and optionally picks ICE by region with libping.

Part of Strike.

Install

npm install strike-fw-network-view strike-fw strike-fw-ui strike-fw-network-check

Optional for dynamic nearest-region:

npm install libping

Peers:

  • strike-fw, strike-fw-ui - rendering (Accordion, Alert, Progress, ...)
  • strike-fw-network-check - scoring / probes
  • libping - required for dynamic nearest-region (browser needs RTCPeerConnection). Optional if you only pass top-level ice or always inject hooks.pingGateways.

Install peers so there is a single strike-fw copy. Nested copies break Accordion hooks (hoist / dedupe; avoid nesting strike-fw under strike-fw-ui).

Usage

import { h, render } from 'strike-fw';
import { NetworkCheckView } from 'strike-fw-network-view';

render(
  h(NetworkCheckView, {
    check: {
      probes: { capabilities: true, audioQuality: true },
    },
    iceByRegion: {
      eu: {
        label: 'Europe',
        iceServers: [{ urls: 'turn:eu.example:3478', username: 'u', credential: 'p' }],
      },
      us: {
        label: 'United States',
        iceServers: [{ urls: 'turn:us.example:3478', username: 'u', credential: 'p' }],
        // optional; otherwise derived from first stun/turn/turns url
        ping: 'stun:us.example:3478',
      },
    },
    guides: {
      'clarity.loss': {
        title: 'Packet loss',
        body: 'Prefer a wired link or move closer to the AP.',
      },
    },
    guideFallback: { title: 'Tip', body: 'See your admin guide.' },
    view: { autoRun: false },
    onComplete: (result) => console.log(result.verdict),
  }),
  document.getElementById('root')
);

ICE precedence

  1. If iceByRegion has one or more keys, that map is used for the run. Top-level ice is ignored.
  2. Otherwise use top-level ice (iceServers and/or fetchIceConfig).
  3. If neither is set, use local TURN defaults: turn:127.0.0.1:3478 with username/credential user / pass (UDP and TCP).

Regions and dynamic

  • With two or more regions, a Select is shown. The first option is always dynamic (label from view.labels.dynamic).
  • With zero or one region, the Select and the resolved-region line are both hidden.
  • When the Select is shown and a run finishes, the resolved region is always shown (Region: Europe (dynamic) or Region: Europe).
  • dynamic calls libping (pingGateways(gateways, { warmup: true })) and picks the lowest finite RTT. If every ping fails or times out, the first Object.keys(iceByRegion) entry is used.

Resolving pingGateways

Order:

  1. hooks.pingGateways (preferred in tests / Node)
  2. globalThis.LibPing.pingGateways
  3. Best-effort import('libping') (CJS interop)

Do not rely on an ESM default import of libping alone in the browser; prefer a script tag that sets globalThis.LibPing, or inject hooks.pingGateways.

Progress (v1)

While running, the view shows Progress plus a short phase label from onProgress (context, capabilities, audio, ...). There is no Stepper in v1.

Hooks for tests

h(NetworkCheckView, {
  iceByRegion: { /* regions */ },
  hooks: {
    pingGateways: async () => [{ code: 'eu', rtt: 40 }],
    runNetworkCheck: async (cfg) => ({ /* NetworkCheckResult */ }),
    onProgress: (phase, ratio) => {},
  },
})

View defaults

autoRun: false, axes / capabilities / environment / guides / MOS on, raw config off, accordionType: 'multiple', defaultOpen: 'first-failure'. Host guides map is not invented by the library.

Exports

NetworkCheckView, listRegions, showRegionSelect, gatewaysForPing, resolveRegionSelection, resolvePingGateways, derivePingUrl, VIEW_DEFAULTS, mergeViewConfig, mergeViewAndCheck, DEFAULT_ICE_SERVERS

Browser smoke / Pages demo

From a clone of this package: examples/browser-smoke.html and docs/ (CDN peers + vendored runtimes for GitHub Pages). Local helper: ./serve-docs.sh (see docs/README.md).

License

MIT