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-bull-bear

v0.1.2

Published

牛熊行情宠物 — DeepSeek Harness 实时行情桌宠:由自选组合平均涨跌驱动,越接近收益 20% 跑得越猛;可拖动、自选面板、行情赛跑。免费新浪实时行情,免登录。

Readme

dsh-bull-bear

牛熊行情宠物 — DeepSeek Harness 实时行情状态宠物:组合越接近收益 20%,牛跑得越猛;跌得越深,熊摔得越戏剧。

一个挂在 DeepSeek Harness Web UI 左下角的行情宠物:读免费实时 A 股行情,把自选篮的平均涨跌变成一只奔跑的牛 / 熊——行情波动越剧烈,它跑得越狂。纯恶搞、无投资建议,仅供自己看着开心。

功能

  • 实时免费行情:新浪 hq.sinajs.cn 公开接口,免登录、免 API key,Node 直连。
  • 组合驱动情绪:宠物追随整个自选篮的平均涨跌——上涨显牛(🐂),下跌显熊(🐻),横盘平静。
  • 戏剧化奔跑(vigor 驱动):平均涨跌越接近 20% 收益,宠物跑得越快、腿摆得越宽、跳得越高、扬尘越密——横盘时安安静静,行情狂奔时它也狂奔。
  • 拟人造型:会奔跑的牛,以及熊大风格的直立拟人熊(红棕毛、白胸带、大圆鼻、绿眼红耳)。
  • 可拖动、可收起:按住宠物可拖到窗口任意位置;不拖动地单击则开关自选面板。
  • 自选面板:逐只列出自选的最新红/绿涨跌,底部显示组合平均,可按名称/代码搜索添加、删除。
  • 🏁 行情赛跑:面板顶部一条"赛道",每只自选一根进度条,长度与其涨跌幅成比例——涨幅最大者占满跑道,其余按相对比例缩放。
  • 可应对大量标的:最多 200 只,按每片 500 只分片抓取,避开新浪单 URL 上限。

安装

# npm 包(预构建,推荐)
dsh plugin --profile web add dsh-bull-bear

# 或本地目录
dsh plugin --profile web add /path/to/dsh-bull-bear

添加后重启一次 dsh web,刷新页面即可看到左下角的牛/熊宠物。

使用

  • 拖动:鼠标按住宠物,拖到窗口任意位置后松开,宠物留在原位(当前会话保持)。
  • 开关面板:不拖动地单击宠物,右侧的自选面板展开/收起。
  • 自选面板:
    • 每行显示股票名称与最新涨跌,配色遵循 A 股习惯——红=涨、绿=跌。
    • 搜索框输入名称或代码(如 茅台、600519),下方出现匹配结果,点击即添加。
    • 行尾的 ✕ 删除该自选。
    • 底部组合平均同样红/绿显示。
    • 改动写入 <workspace>/.bull-bear-watchlist.json,启动时重新应用(最多 200 只)。
  • 🏁 行情赛跑:面板最上方的赛道,按涨跌排序列出前 6 名自选;每根进度条宽度以当前最大涨幅为满幅,其余按相对比例缩放——一眼看出谁的涨幅量级最大。

配置

| 键 | 默认 | 说明 | | --- | --- | --- | | symbols | 上证/深成/创业板/茅台/宁德 | 自选标的(新浪代码,如 sh000001、sz399001;支持 6 开头自动识别为沪市) | | refreshMs | 5000 | 行情刷新周期(毫秒) | | sensitivity | 1 | 速率→抬/低头角度放大倍数(0.1–5) |

主代码默认值在 src/index.js 的 config 对象中;运行期可通过 RPC 动态调整。

原理

  • Host 半(src/index.js):每 refreshMs 用原生 fetch 请求新浪 hq.sinajs.cn,GBK 解码,计算每个标的相对昨收的涨跌幅(pct)与其速率,再求组合平均(avgPct、avgRate)。新浪对超过约 800 只的一个 URL 会返回 HTTP 431,因此按每片 500 只分片并发抓取后合并。另有 search 操作经腾讯 smartbox 按名称/代码解析证券。全部通过官方 ctx.connection.rpc.handle('/bullbear'...) 通道暴露。
  • Client 半(src/client/index.js):轮询 RPC,由 |avgPct| / 20 推导一个封顶的 vigor(市场强度),缩放奔跑速度、腿摆幅度、跳跃高度与扬尘浓度;动画循环逐帧驱动四肢。面板与赛道读取同一份数据。注册进 shell.overlay 槽位。

窗口内 mood 判定:组合 avgPct > 0.05 显示牛、avgPct < -0.05 显示熊、其余横盘。

免责声明

  • 数据来自新浪财经公开 Web 接口,仅供学习与研究,不构成任何投资建议;请勿高频请求,遵守目标站点条款。
  • 本插件非任何券商或行情服务商的官方产品。

License

MIT