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

@coveragemap/speed-test

v0.5.0

Published

Test your internet speed with CoverageMap.com

Readme

@coveragemap/speed-test

npm License: Apache 2.0 Node.js

CoverageMap's speed-test library for browser and backend environments. Measures latency, download throughput, and upload throughput using CoverageMap's speed-test protocol and infrastructure.


Table of Contents


Installation

npm install @coveragemap/speed-test

Requirements: Node.js ≥ 20


Quick Start

import { SpeedTestEngine } from '@coveragemap/speed-test';

const engine = new SpeedTestEngine({
  application: {
    id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
    name: 'My App',
    version: '1.0.0',
    organization: 'My Org',
    type: 'web',
  },
  callbacks: {
    onStageChange: (stage) => console.log('stage:', stage),
    onDownloadProgress: (snap) => console.log('download Mbps:', snap.speedMbps),
    onUploadProgress: (snap) => console.log('upload Mbps:', snap.speedMbps),
    onError: (error, stage) => console.error(stage, error.message),
  },
});

const result = await engine.run();
console.log(result.results.measurements);

The engine runs a full sequence — latency → download → upload — against the nearest CoverageMap server, and returns a typed result payload.


Configuration

Required: Application Metadata

Every SpeedTestEngine instance requires an application block. This metadata is embedded in every saved result.

| Field | Type | Description | |---|---|---| | id | string | UUID that uniquely identifies your application | | name | string | Human-readable application name | | version | string | Application version | | organization | string | Organization or publisher name | | type | string | One of: web, backend, mobile, desktop, cli, serverless, other | | website | string | (Optional) Application URL |

Optional: Select Tests

All three tests run by default. Disable individual phases as needed:

const engine = new SpeedTestEngine({
  application: { /* ... */ },
  tests: {
    latency: true,
    download: true,
    upload: false,
  },
});

Optional: Overrides

Constructor options (config) — fine-grained timing and behaviour controls:

| Field | Range | Default | Description | |---|---|---|---| | config.pingCount | 5–50 | 10 | Number of latency pings per run | | config.downloadDurationMs | 3000–30000 | 10000 | Download test duration (ms) | | config.uploadDurationMs | 3000–30000 | 10000 | Upload test duration (ms) | | config.snapshotIntervalMs | 50–5000 | 100 | How often progress snapshots are emitted (ms) | | config.latencyTimeoutMs | 3000–30000 | 10000 | Latency phase timeout (ms) | | config.estimationTimeoutMs | 3000–30000 | 15000 | Estimation phase timeout (ms) | | config.throughputThreads | 0–64 | 0 | Node.js worker threads for multi-gigabit stages (0 = automatic, 1 = calling thread only) | | config.transport | auto, tcp, ws, wss | auto | auto uses the fastest transport the server offers: raw TCP in Node.js, then WebSocket, then secure WebSocket only where required (HTTPS pages) | | config.browserWorker | true, false | true | In browsers, run the test in a Web Worker so the page's rendering cannot slow it; the page's main thread is used where a worker cannot start |

Providers — set after construction or at the module level:

| Method / Function | Description | |---|---| | engine.setLocationProvider(provider \| null) | Live coordinates provider; falls back to IP-based location when null | | engine.setNetworkProvider(provider \| null) | Overrides resolved connection type and cellular/Wi-Fi/wired metadata used in results + stages | | engine.setDeviceMetadataProvider(provider \| null) | Overrides device identity and host telemetry in the device result block; restores DefaultDeviceMetadataProvider when null |


Data Upload

Completed test results are uploaded to CoverageMap systems (map.coveragemap.com) for analysis, benchmarking, and network quality metrics.

If an upload fails, results are queued locally and retried automatically in the background on the next run.

Disclaimer: All speed test results produced by this library — including measurement data, device metadata, and application identity — are uploaded to and retained by CoverageMap. By using this library, you acknowledge that result data will be used by CoverageMap to power network quality mapping, coverage analytics, and related services on coveragemap.com. Do not use this library in contexts where uploading network measurement data to a third party is not permitted.


Fair Use Policy

This library uses CoverageMap's speed-test infrastructure to run measurements. To keep the service available and performant for everyone, please observe the following:

  • Tests should be initiated in response to a genuine need — user-triggered measurements, scheduled monitoring at a reasonable cadence, or one-off diagnostics. Do not use this library to benchmark or stress-test CoverageMap's servers.
  • Automated or scheduled tests must run no more than once per 10 minutes per application. Running tests more frequently than this is considered abusive and puts unnecessary load on shared infrastructure.
  • Each application must provide accurate application.id, application.name, and application.organization metadata. Misrepresenting or omitting this information is a violation of fair use.

CoverageMap reserves the right to rate-limit or block any application ID that is found to be abusing the infrastructure. If your application is blocked, contact us through the repository to discuss your use case.


Development

npm run lint        # ESLint
npm run typecheck   # TypeScript type check (no emit)
npm run test        # Unit tests (Vitest)
npm run test:deploy # Live deploy-time validation against real servers
npm run build       # Compile to dist/

A runnable React + Vite sample app is available in demos/react-vite.


Documentation

| Document | Description | |---|---| | Protocol | WebSocket protocol specification | | Library API | Full API reference | | Result Schema | Result payload type definitions | | Backend Integration | Node.js / server-side usage guide | | Examples | Usage examples and recipes |


Contributing

Issues and pull requests are welcome. Please open an issue first to discuss significant changes.


License

Apache 2.0 © CoverageMap