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-report-html

v1.8.1

Published

Generate self-contained interactive HTML reports from Markdown, tables, and chart data

Readme

dsh-report-html — 把数据变成算得准、交得出手的分析报告

npm version GitHub release license

🇨🇳 中文 | 🇬🇧 English

DeepSeek Harness 里,把数据变成 一份算得准、交得出手的分析报告:模型负责判断和叙事,插件负责计算和渲染—— 统计数字由代码计算(不靠模型脑补),报告是自包含的单文件 HTML,可以转 Word/PPT、 批量打包,还能按 cron 定时生成并推到飞书/钉钉。

为什么用 dsh-report-html

  • 省的是时间,不是「更好看」:周报月报、经营分析、A/B 实验这类高频重复劳动, 配一次报表机器人,到点自动出报告。
  • 数字算得准:均值/中位数、相关性、离群点、Welch t 检验 p 值、达成率、 环比/同比/月同比/季同比、排名变动,全部由经过单元测试的代码计算。
  • 交付物完整:12 种图表(含中国地图、箱线图、雷达图)、可排序筛选的表格、 KPI 卡片、下钻明细、主题切换、打印 PDF——单文件离线可开。
  • 接入办公链路:数据来自 CSV / Excel / JSON / PostgreSQL / MySQL / SQLite, 输出 HTML / Word / PPT / zip 批量包,推送到飞书/钉钉 webhook。
  • 中英文双语:KPI、图表标题、章节、洞察文案随 language: auto | zh | en 切换。

安装

dsh plugin --profile web add dsh-report-html   # 从 npm 安装
dsh plugin --profile web add github:hccccc01333/dsh-report-html   # 或从 GitHub

快速上手

给模型一行话,它就会调用插件:

分析这些数据并写报告到 D:\reports\sales.html:
[{"month": "2026-01", "channel": "Online", "revenue": 120000}, ...]
把这几个 CSV 做成批量报告 zip 放到 D:\reports\batch.zip
对比 control 和 variant 两组 revenue 的差异是否显著,出 A/B 报告

工具一览

| 工具 | 做什么 | | --- | --- | | report_html | 把 Markdown/表格/图表数据渲染成自包含 HTML(或 Word/PPT) | | report_analysis | 自动分析一份数据:指标、图表、洞察、达成率/环比/同比/排名/数据校验 | | report_batch_analysis | 多份数据一次分析,打包成 zip(含索引页) | | report_compare | 两组 A/B 对比:均值差、lift%、Welch t 检验 p 值、类别拆分 | | report_sql | 只读 SQL(PostgreSQL/MySQL/SQLite)→ 完整分析流水线 → 报告 |

通用参数:template(analysis/executive/weekly/teaching)、language(auto/zh/en)、 goal(目标列,算达成率)、topN(排名深度)、source(数据来源说明)、 format(html/docx/pptx)、webhook(生成后推送摘要)。服务端数据库密码从 DSH_DB_PASSWORD 环境变量读取,不进工具参数。

自动报表机器人

包内自带 CLI:一份 JSON 任务文件,把「查数 → 分析 → 出报告 → 推送」串成定时任务。

{
  "jobs": [
    {
      "name": "daily-sales",
      "schedule": "0 9 * * 1-5",
      "output": "D:/reports/daily-sales.html",
      "connection": { "engine": "sqlite", "file": "D:/data/sales.db" },
      "query": "SELECT month, channel, revenue, target FROM sales",
      "template": "weekly",
      "language": "zh",
      "goal": "target",
      "source": "sales.db",
      "webhook": "https://open.feishu.cn/open-apis/bot/v2/hook/your-token"
    }
  ]
}
dsh-report-html run jobs.json           # 常驻调度,到点自动跑
dsh-report-html run jobs.json --once    # 立即全部跑一次(给 CI/外部调度用)

完整示例见 examples/jobs.example.json

报告能力

  • 模板analysis(完整摘要)/ executive(摘要 + 建议)/ weekly(周报,带周环比)/ teaching(讲解 + 练习)
  • 指标:目标达成率、环比、同比、月同比、季同比、类别排名(含排位变化)、 数据质量校验(重复行/缺失/高缺失列)、Welch t 检验
  • 图表:bar / line / area / pie / scatter / heatmap / 中国地图 / flow / funnel / gauge / box / radar,全部支持下钻与全屏
  • 数据入口:JSON 数组、CSV、Excel (.xlsx)、本地文件、PostgreSQL、MySQL、SQLite
  • 交付:HTML(自包含)、Word、PPT、zip 批量包、飞书/钉钉 webhook 推送

与 dsh-report-card 联动

dsh-report-card 是宿主端的 card: 'report' 渲染协议:构建在该 fork 之上的 DeepSeek Harness 会把插件生成的 报告 HTML 直接内联渲染在对话里(沙箱 iframe),批量 zip 则以多标签卡片展示; 标准宿主自动回退为通用结果卡片。插件只输出协议载荷,不依赖宿主端。

示例画廊

真实工具生成的示例报告已提交,可直接打开:

开发

pnpm install --ignore-workspace
pnpm --ignore-workspace test              # 单元测试
pnpm --ignore-workspace test:coverage     # 覆盖率门槛(90/95/70)
pnpm --ignore-workspace test:snapshot     # 全文档渲染快照
pnpm --ignore-workspace lint / jsdoc / design:lint
pnpm --ignore-workspace examples          # 重新生成示例画廊

版本

从 1.0.0 起遵循语义化版本:工具名、必填参数、输出字段与文档化 API 是兼容面; 渲染字节不承诺(视觉优化属于 minor)。发布由 git tag 触发 CI 全自动完成。

License

MIT