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-whale-usage

v0.1.4

Published

桥接后的新产物:把 dsh-whale-widget(桌面鲸鱼挂件)与 dsh-usage-stats(用量统计)合并为一个自包含插件,并在挂件上提供「记账 / 实时令牌 / 应用用量」配置界面。不改原插件包,对上游更新免疫。

Readme

🐳 dsh-whale-usage

自包含的 DSH 插件:把两款插件合并成一个,并在桌面小鲸鱼挂件上新增**「记账 / 实时令牌 / 应用用量」**配置界面。

不改动原插件包 —— 从底层吸收原插件源码逻辑,因此 对上游更新免疫。安装后你可以少维护两个插件(原 dsh-whale-widget 与 dsh-usage-stats 可卸载)。

✨ 这是什么

| 吸收的来源 | 底层能力 | 原作者 / 仓库 | |---|---|---| | dsh-whale-widget | 右下角 DeepSeek 余额小鲸鱼挂件(余额、峰谷定价、随机台词与音效、记账 / 令牌两种用量模式) | zhu1090093659/dsh-web-ui | | dsh-usage-stats | 按 DSH 会话计算的应用用量数据引擎(token 趋势、模型分解、活跃度) | lanlandeli/dsh-usage-stats |

dsh-whale-usage 是二者的桥接与合并产物:用一个自包含插件取代上面两个插件。版权致谢见 CREDITS.md。

💡 功能

  • 鲸鱼挂件 —— 原样保留:余额、今日已用、峰谷定价、音效、可拖拽。
  • 用量配置界面 —— 点击侧边栏底部鲸鱼按钮打开「小鲸鱼 · 用量配置」浮层,可配置:
    • 记账:用余额正差值累计当天用量(跨天自动归零并入历史账本)。
    • 实时令牌:用 DeepSeek 平台令牌实时计算今日用量。
    • 应用用量:展示 DSH 会话的本机用量(今日/近 7 天 Tokens、会话、消息、最常用模型)。

🖼️ 截图

🚀 安装

作为普通包安装,切勿用 junction 链接。 junction 会让依赖(如 schemastery/react)无法向上解析,并使包名与 cordis.patch.yml 不一致——两者都会导致 DSH 启动失败。

# 推荐 —— 从 npm 安装(已发布):https://www.npmjs.com/package/dsh-whale-usage
dsh plugin --profile web add dsh-whale-usage
# 或:npm install dsh-whale-usage

# 从源码:本仓库(或在目标机器上 git clone 后)
dsh plugin --profile web add <本仓库绝对路径>

# 或安装构建产物
dsh plugin --profile web add <路径>/dsh-whale-usage-0.1.4.tgz

# 或用一键脚本
bash scripts/install.sh                                        # macOS / Linux / Git Bash
powershell -ExecutionPolicy Bypass -File scripts/install.ps1   # Windows

安装后重启 DSH 并硬刷新浏览器(Cmd/Ctrl+Shift+R):

  • 右下角出现鲸鱼挂件;
  • 侧边栏底部出现「小鲸鱼·用量」按钮。

因为本插件取代了原两个插件,建议确认正常后再卸载: dsh plugin --profile web remove dsh-whale-widget · dsh plugin --profile web remove dsh-usage-stats

⚙️ 配置

config:
  indexConcurrency: 2      # 用量引擎读取历史会话的并发
  cacheWriteDelayMs: 1000  # 本地统计写入前的防抖延迟
  apiPath: /usage-stats/v1 # 应用用量 API 前缀

数据均保存在本机:

  • 鲸鱼记账 / 配置:~/.dsh/.dshw-*.json
  • 应用用量索引:$DSH_HOME/usage-stats

🗂️ 仓库结构

dsh-whale-usage/
├── lib/                # 构建产物(宿主: index.js, usage-host.js, whale-host.js;客户端: client.js)
├── assets/             # 鲸鱼图片 / 音效
├── cordis.patch.yml    # DSH bundle patch(插件 id dsh-whale-usage)
├── dsh.plugin.json     # DSH 插件清单(id / version / main / client.main)
├── package.json        # npm 包(name dsh-whale-usage, MIT)
├── LICENSE / CREDITS.md# MIT + 上游致谢
├── README.md / README.zh.md
├── docs/               # 开发说明(development.md)+ 截图
└── scripts/install.*   # 一键安装脚本

🛠️ 开发

架构、npm pack 出 tgz、以及同步上游修复(lib/whale-host.js、lib/usage-host.js)见 docs/development.md。

📄 许可与致谢

  • 许可:MIT。合并吸收的第三方源码版权归其原作者——见 CREDITS.md。
  • 本插件自包含:不随上游自动变化;修复/跟进见 docs/development.md。

English README: README.md。