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

@rdjksp/docx-utils

v0.3.5

Published

DOCX 文本工具集,支持文档解析、图表引用查找、AI 审查等功能

Readme

docx-utils

To install dependencies:

deno install

To run:

docx-utils echo ./demo.docx
docx-utils echo ./demo.docx '\n'
docx-utils find-space ./demo.docx
docx-utils find-space ./demo.docx 5
docx-utils find-space ./demo.docx 5 12
docx-utils find-space ./demo.docx 5 12 --context 20
docx-utils refs ./demo.docx pic def
docx-utils refs ./demo.docx pic use
docx-utils refs ./demo.docx table def
docx-utils refs ./demo.docx table use
docx-utils ai-review ./demo.docx --rules ./rules.md
docx-utils ai-review ./demo.docx --rules ./rules.md --max-iterations 20

CLI commands:

docx-utils echo <fileName> [newlinePlaceholder]
docx-utils find-space [options] <fileName> [arg1] [arg2]
docx-utils refs <fileName> <table|pic> <def|use>
docx-utils ai-review <fileName> --rules <rules.md> [--max-iterations <n>]
  • echo: 输出 rawText。可指定换行符占位符(如 \n),不指定则直接输出换行符。
  • find-space: 统计空格数量并输出每个空格附近上下文。
  • refs: 查找图/表题(def)或引用(use)。
  • ai-review: 使用 AI 按章节规则审查 docx 内容。
  • 未指定 arg1/arg2: 全部打印。
  • 仅指定 arg1: 打印 [arg1, arg1+20)。
  • 同时指定 arg1 和 arg2: 打印 [arg1, arg2)(左闭右开)。
  • 可选 --context/-c: 设置前后预览长度,默认 10。

refs 用法说明:

# 固定参数顺序
docx-utils refs <fileName> <table|pic> <def|use>

# 常见示例
docx-utils refs ./demo.docx pic def
docx-utils refs ./demo.docx pic use
docx-utils refs ./demo.docx table def
docx-utils refs ./demo.docx table use

匹配规则:

  • table: 匹配 表x-y
  • pic: 匹配 图x-y
  • def: 匹配“定义”:图/表x-y + 空格 + 非空格{1,}
  • use: 匹配“使用”:图/表x-y 后直接接非空格或行尾

AI 审查配置(.env / .env.local):

  • .env 和 .env.local 都会被加载,.env.local 会覆盖同名配置。
  • provider 的 model/base URL 必须配置,否则会直接报错。
  • 支持 openai 和 deepseek provider。
  • 示例已放在项目根目录的 .env 文件中。