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-api-balance

v1.2.1

Published

DeepSeek Harness web widget: API balance badge with today/month token usage, cache-hit donut chart and cost estimate. Hosts GET /api-balance and injects a bottom-right badge into the dsh web UI.

Downloads

991

Readme

dsh-api-balance

DeepSeek Harness 网页界面右下角的 API 余额角标:余额 + 当日/当月 token 用量与花费 + 缓存命中环形图。

功能

  • 总余额 / 赠送 / 充值(DeepSeek 官方 /user/balance 接口)
  • 当日 / 当月 token 用量与估算花费(单价可改)
  • 缓存命中环形图:命中率 + 命中/未命中量(命中绿、未命中琥珀)
  • API Key 不出服务器:走 dsh 凭据服务,浏览器只拿结果
  • 5 分钟自动刷新,点击立即刷新;统计持久化,重启不丢

安装

dsh plugin --profile web add dsh-api-balance
# 重启 dsh web 后 Ctrl+F5 强刷页面

要求:dsh >= 0.1.0-rc.3(node >= 22);DEEPSEEK_API_KEY 可被 dsh 凭据服务解析。

卸载

dsh plugin --profile web remove dsh-api-balance

配置(计费口径)

价格内置 DeepSeek 官方 deepseek-v4-flash 定价(USD/百万 tokens),并按 2026-08-16 16:00 UTC 起的分时计价自动切换(peak: 01-04/06-10 UTC):

| 时段 | 缓存命中 | 未命中输入 | 输出 | |------|---------|-----------|------| | 2026-08-16 前(V4-Flash-0731) | $0.0028 | $0.14 | $0.28 | | 之后 off-peak | $0.007 | $0.22 | $0.66 | | 之后 peak | $0.014 | $0.44 | $1.32 |

花费 = token 量 × 单价(USD→CNY 按 FX=7.2 换算,可改),每次查询动态计算——调价后历史数据自动用新价重算。

工作原理

host 半端注册 GET /api-balance(余额+统计)、监听 session/event 提取 usage(含缓存命中)、 tapIndex 注入角标脚本到首页 HTML。纯 host 插件 + 注入式前端,不依赖 client-plugin 打包链。

License

MIT