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

diter89speedtest

v2.0.0

Published

Modern internet speed test library & CLI using Cloudflare — measure download, upload, ping & jitter with zero dependencies

Readme

diter89speedtest

Modern internet speed test library & CLI using Cloudflare endpoints — measure download, upload, ping & jitter with zero runtime dependencies.

Features

  • Download speed — progressive multi-size test (1MB → 10MB → 25MB)
  • Upload speed — POST test to Cloudflare
  • Ping & Jitter — 10-sample latency test with min/max/avg/jitter
  • ISP detection — auto-detect IP, ISP, server location via Cloudflare trace
  • CLI — run npx diter89speedtest for instant results
  • Programmatic API — use as a library in your Node.js app
  • Zero dependencies — only Node.js built-ins
  • Pretty output — boxed terminal output with emoji
  • JSON mode--json flag for scripting
  • Simple mode--simple for one-line output

Install

npm install diter89speedtest

CLI Usage

# Pretty output (default)
npx diter89speedtest

# JSON output for scripting
npx diter89speedtest --json

# Simple one-line output
npx diter89speedtest --simple

CLI Output Example

╔══════════════════════════════════════════╗
║         🚀 Speed Test Results           ║
╠══════════════════════════════════════════╣
║  ISP:       Mozilla/5.0...              ║
║  IP:        103.xxx.xxx.xxx             ║
║  Server:    CGK                          ║
╠══════════════════════════════════════════╣
║  Ping Avg:  12 ms                       ║
║  Ping Min:  8 ms                        ║
║  Jitter:    3 ms                        ║
╠══════════════════════════════════════════╣
║  Download:  45.23 Mbps                  ║
║  Upload:    22.10 Mbps                  ║
╚══════════════════════════════════════════╝
  Timestamp: 2025-07-07T12:00:00.000Z

Programmatic API

const { runSpeedTest, SpeedTest } = require('diter89speedtest');

// Quick run
const result = await runSpeedTest();
console.log(result.download.formatted); // "45.23 Mbps"
console.log(result.upload.formatted);   // "22.10 Mbps"
console.log(result.ping.avg);           // 12

// With options & progress
const test = new SpeedTest({
  downloadSizes: [1e6, 1e7],  // Custom download sizes (bytes)
  uploadSize: 1e6,            // Custom upload size (bytes)
  pingCount: 20,              // Number of ping samples
  timeout: 60000,             // Request timeout (ms)
  onProgress: (phase, msg) => {
    console.log(`[${phase}] ${msg}`);
  },
});

const result = await test.run();

Result Object

{
  timestamp: string;          // ISO 8601
  isp: {
    ip: string;               // Your public IP
    isp: string;              // User agent / ISP info
    colo: string;             // Cloudflare colo code
    location: string;         // Lat,Lng
  };
  ping: {
    avg: number;              // Average ping (ms)
    min: number;              // Minimum ping (ms)
    max: number;              // Maximum ping (ms)
    jitter: number;           // Jitter (ms)
  };
  download: {
    speed: number;            // Raw speed (bps)
    formatted: string;        // Human-readable (e.g. "45.23 Mbps")
    bytes: number;            // Total bytes downloaded
    elapsed: number;          // Total time (seconds)
    samples: number;          // Number of download tests
  };
  upload: {
    speed: number;            // Raw speed (bps)
    formatted: string;        // Human-readable
    bytes: number;            // Total bytes uploaded
    elapsed: number;          // Total time (seconds)
  };
}

API Reference

| Export | Type | Description | |--------|------|-------------| | SpeedTest | Class | Full speedtest with configurable options | | runSpeedTest(options?) | Function | Convenience wrapper — runs test and returns result | | formatSpeed(bps) | Function | Format bits/sec to human-readable string | | formatBytes(bytes) | Function | Format bytes to human-readable string | | cli() | Function | Run CLI mode programmatically |

License

ISC