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-cost-balance-pro

v0.1.6

Published

DSH plugin: visible cost/balance stats pill below the composer, with settings page and one-click reset. Fixed fork-level issues of dsh-cost-balance (slot id collision, missing ctx, invisible 5px bar).

Downloads

901

Readme

dsh-cost-balance-pro

DSH 插件:输入框下方可见文字的会话花费/余额统计条,带设置页与一键还原。

能力

  • 折叠态直接显示 余额(¥)· 本次花费($),点击展开明细(缓存命中 / Token / 花费 / 余额)
  • 设置页(设置 → 插件 → 余额统计条):显示开关(余额/花费/命中率)、字号(10–16px)、颜色(跟随主题/灰色/自定义取色器)、一键还原
  • 配置持久化于 $DSH_HOME/dsh-cost-balance-pro.json,重启保留,保存后统计条即时刷新

设置页字段

| 字段 | 类型 | 默认值 | 说明 | |---|---|---|---| | showBalance | boolean | true | 折叠态显示余额 | | showCost | boolean | true | 折叠态显示本次花费 | | showHitRate | boolean | true | 展开面板显示缓存命中率 | | costCurrency | enum | cny | 花费货币:cny 人民币 / usd 美元 | | balanceCurrency | enum | cny | 余额货币:cny 人民币 / usd 美元 | | usdCnyRate | number | 6.82 | USD→CNY 汇率(余额/花费换算用,官方峰谷价隐含值) | | fontSize | number | 12 | 折叠态字号,限制 10–16 | | colorMode | enum | auto | auto 跟随主题 / mono 灰色 / custom 自定义 | | customColor | string | #8b5cf6 | colorMode=custom 时的文字颜色(#RRGGBB) |

相对 dsh-cost-balance 的修复

  1. 槽位注册 id 改为唯一 cost-balance-pro,不再与官方统计栏冲突(原版同槽同 id 同 priority 会挂掉整个前端);
  2. ctx 经 props 传入组件(原版模块级裸 ctx 导致槽位条目渲染期 ReferenceError,药丸从未渲染成功);
  3. 折叠态从 5px 无字细线改为可见文字;
  4. 客户端工厂补上 return module.exports(缺失时加载器收到 undefined,插件静默失效);
  5. 客户端模块声明 exports.inject = ['timer']ctx.interval 需要 timer 注入)。

安装

dsh plugin --profile web add dsh-cost-balance-pro

装后重启服务一次(或下次登录),刷新页面即可看到统计条;样式去设置页调整。

模型定价(峰谷计费)

DeepSeek 自 2026-08-17 起执行峰谷计费:高峰 = UTC 01:00-04:00 与 06:00-10:00(北京 09:00-12:00 / 14:00-18:00),谷价为峰价一半。本插件按当前时段自动计价,折叠态显示 峰/谷 徽标(峰橙、谷绿),展开面板显示当前时段说明。

内置官方价(USD/1M):

| 模型 | 时段 | 缓存命中 | 未命中 | 输出 | |---|---|---|---|---| | V4-Flash | 峰 | 0.014 | 0.44 | 1.32 | | V4-Flash | 谷 | 0.007 | 0.22 | 0.66 | | V4-Pro | 峰 | 0.044 | 1.32 | 3.96 | | V4-Pro | 谷 | 0.022 | 0.66 | 1.98 |

可在 profile 的 cordis.patch.yml 按 id 覆盖整行 config 传入 prices(结构 { 模型: { peak: {hit, miss, out}, offPeak: {...} } })。

开发

npm test          # 客户端契约测试(node:test)
npm pack --dry-run

发布:push v* 标签触发 GitHub Actions,经 npm OIDC trusted publishing 自动发布(带 provenance)。

License

MIT