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

dsh-token-usage-widget

v1.0.3

Published

Live token usage in the sidebar with per-provider and per-model drill-down, plus usage statistics: time-range picker, hourly/daily bar charts and a 400-day heatmap. All data stays local.

Readme

dsh-token-usage-widget(Token 用量助手)

在 DeepSeek Harness 侧栏底部实时显示当天 Token 用量的插件,支持按模型服务商(DeepSeek、Kimi / Moonshot、智谱、通义、豆包等国内外厂商自动识别)与具体模型(如 Kimi 下的 k3)逐层钻取,并内置完整的用量统计对话框。

效果预览

侧栏底部实时显示今日用量(自动刷新,可点击):

侧栏今日用量方框

点开方框,按服务商 → 模型逐层钻取:

服务商与模型明细

右下角「用量统计」打开完整统计:时间范围筛选、按小时/按天柱状图、缓存命中率:

用量统计对话框

功能

  • 侧栏底部方框:今日 Token 总消耗实时刷新(输入 + 缓存读 + 缓存写 + 输出),带各服务商配色分段条;侧栏折叠时自动变成紧凑图标
  • 展开面板:今日各服务商用量(请求数、模型数),点击服务商展开模型明细(输入 / 输出 / 缓存 / 推理)
  • 用量统计对话框:
    • 时间范围:当天 / 近 24 小时 / 近 7 天 / 近 14 天 / 近 30 天 / 全部
    • 汇总指标:总请求数、消耗 Tokens、缓存命中率
    • 柱状图:当天与近 24 小时按小时,其余按天;悬停显示精确 Tokens 与请求数
    • 全部范围:400 天用量热力图(青色→蓝色渐变,颜色越深用量越多,悬停显示当日明细)
  • 数据:全部存在本机(~/.dsh/token-usage-widget/store.json),不上传任何数据;天级保留 400 天、小时级 48 小时,安装后自动回填历史会话日志

安装

在 Harness 的插件管理中搜索 dsh-token-usage-widget 一键安装;或让 agent 执行:

安装 npm 插件 dsh-token-usage-widget 并启用

也可以下载本包后用「本地目录安装」。安装完成启用即可,无需重启。

使用

  1. 看侧栏底部(设置按钮旁边)的「今日用量」方框
  2. 点开方框 → 服务商 / 模型明细
  3. 点右下角「用量统计」→ 完整统计对话框

卸载

插件管理页关闭开关或卸载即可;统计文件可手动删除 ~/.dsh/token-usage-widget/。

License

MIT