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

@cliven/dsh-ofd-viewer

v0.1.2

Published

OFD document preview for DSH: read OFD in the Sidebar, the OFD panel and composer attachments, plus an ofd_read tool

Readme

English | 中文

能做什么

DSH 自带的文档预览覆盖 PDF、Word 等格式,但国内公文、电子发票、合同与档案大量使用 OFD。 装上前,.ofd 在右侧栏里只显示成二进制;装上后:

  • 右侧栏直接看:文件树、交付卡片、@文件 引用里点 .ofd,与 PDF/Word 预览并列,走同一套文档预览框架。
  • 草稿附件先看:输入框附件卡片上直接有「查看」,文件还没提交给模型也能先翻一遍。
  • 模型读得到:ofd_read 工具返回页数、版本、文档信息与每页文本,不用渲染也能回答“这张发票的金额是多少”。
  • 功能全开:连续滚动、缩放/旋转、页码跳转、缩略图、大纲、书签、附件、图层显示控制、全文查找、文本选中复制、打印、图片导出、原始 OFD 导出、签章覆盖层与验证。
  • 中文不缺字:内置思源宋体/黑体,文档没有内嵌字体时也不会整页空白。

阅读器基于官方 ofdrw-viewer-ui 的 npm 包 @ofdrw/ofdrw-viewer-ui(MIT)。

安装

在 DSH 的 设置 → 插件 → 添加插件 中填入插件名与版本号:

@cliven/[email protected]

安装界面示意:

也可以用命令行安装:

dsh plugin --profile web add @cliven/[email protected]

版本号固定为当前发布版本(现在是 0.1.2),升级时替换 @ 后面的数字即可。

离线安装(tgz 见 Releases):

dsh plugin --profile web add /绝对路径/cliven-dsh-ofd-viewer-0.1.2.tgz

安装后重启 DSH Web 服务并刷新页面:客户端启动图在进程启动时组合,已经运行的进程不会自动加载新插件。

从源码构建并挂到本地 profile 的方法见开发文档。

使用

两处入口

| 入口 | 操作 | 说明 | | --- | --- | --- | | 输入框附件 | 拖入或选择 .ofd → 附件卡片点「查看」 | 草稿文件尚未提交也能先看内容;粘贴的图片照常显示缩略图 | | 右侧栏文档预览 | 文件树、交付卡片、@文件 引用里点 .ofd | 与 PDF/Word 预览并列,复用同一套文档预览框架 |

草稿附件的「查看」入口示意:

ofd_read 工具

给模型用的工具,参数与返回如下:

| 参数 | 类型 | 说明 | | --- | --- | --- | | path | string,必填 | OFD 路径,相对路径以会话工作目录为基准 | | pages | string | 页码选择:"3"、"1-5"、"1,3,7-9";可带页内区间,如 "4#2001-4000"、"4-6#1-500";省略时取前若干页 | | maxPages | integer | 最多返回页数,默认 30 | | maxCharsPerPage | integer | 每页最多返回的字符数(按 Unicode 字符计),默认 4000 | | includeText | boolean | false 时只返回元数据,默认 true |

返回页数、OFD 版本、文档信息(DocInfo)、returnedPages、每页文本与解压失败的条目。

许可

本插件代码以 MIT License 发布,Copyright (c) 2026 Quan Guanyu。

内置字体思源宋体/黑体为 SIL Open Font License 1.1(来源与子集范围见 assets/fonts/NOTICE.md);阅读器 @ofdrw/ofdrw-viewer-ui 同为 MIT。