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

@mazhu/speedtest

v1.0.1

Published

⚡ 命令行网速测试工具 — 比 speedtest.net 更方便

Downloads

249

Readme

⚡ @mazhu/speedtest

命令行网速测试工具 — 比 speedtest.net 更方便

零依赖、纯 Node.js 实现,支持下载/上传测速、Ping、DNS 解析测试。

安装

npm install -g @mazhu/speedtest

使用

🚀 完整测试

speedtest run

输出示例:

  ⚡ Speedtest — 网速测试

  [1/3] 🏓 延迟测试
  ─────────────────────────
  延迟: 12.5 ms | 抖动: 3.2 ms

  [2/3] 📥 下载速度测试
  ─────────────────────────
  下载: 156.32 Mbps (18.42 MB)

  [3/3] 📤 上传速度测试
  ─────────────────────────
  上传: 48.76 Mbps (5.78 MB)

  ═════════════════════════
  📊 测试结果汇总
  ═════════════════════════
  Ping:    12.5 ms
  下载:    156.32 Mbps
  上传:    48.76 Mbps

  评级:    A+

🏓 Ping 测试

speedtest ping
speedtest ping -h github.com -c 20

📥 下载测速

speedtest download
speedtest download -t 15    # 测试 15 秒

📤 上传测速

speedtest upload
speedtest upload -t 15      # 测试 15 秒

🔍 DNS 解析测试

speedtest dns
speedtest dns -d github.com -c 5

自动对比 5 个常用 DNS 服务器(Google、Cloudflare、AliDNS、DNSPod)。

📋 历史记录

speedtest history
speedtest history -l 20     # 显示最近 20 条
speedtest history --clear   # 清除记录

命令参考

| 命令 | 说明 | |------|------| | speedtest run | 完整速度测试 (ping + download + upload) | | speedtest ping | 网络延迟测试 | | speedtest download | 下载速度测试 | | speedtest upload | 上传速度测试 | | speedtest dns | DNS 解析速度测试 | | speedtest history | 查看历史记录 |

通用选项

| 选项 | 说明 | |------|------| | -j, --json | 以 JSON 格式输出 | | -h, --help | 显示帮助 |

技术实现

  • 零外部依赖:仅使用 Node.js 内置模块 (http/https/dns/child_process)
  • Cloudflare Speed 测速端点:使用 speed.cloudflare.com 作为默认测速服务器
  • 彩色终端输出:实时进度条 + 颜色编码结果
  • 自动历史记录:测试结果保存到 ~/.speedtest/history.json

评级标准

| 评级 | 条件 | |------|------| | A+ | 高带宽 + 低延迟 | | A | 良好网络 | | B | 一般网络 | | C | 网络较差 | | D | 网络很差 |

License

MIT © Mike Wang