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

moguan-pdf

v0.3.0

Published

墨观 MoGuan PDF 命令行工具——本地处理·不上传:合并/旋转/提取/加页码/证件排版/转图/长图/压缩/水印/裁边/去白页/OCR 等子命令,复用浏览器站同一份 @moguan/pdf-core 核心。

Readme

moguan-pdf

墨观 MoGuan PDF 命令行工具 —— 全部本地处理、绝不上传文件。与在线站 moguanpdf.com 复用同一份 @moguan/pdf-core 核心,脱离浏览器独立运行。

OCR 模型、字体、cmaps、wasm 等资产随包自带(离线可用,不联网)。

安装

npm i -g moguan-pdf
# 或直接用:
npx moguan-pdf <命令> ...

需要 Node ≥ 22.13(pdfjs-dist 5.x 的引擎要求)。渲染/压缩/水印/OCR 等命令依赖 @napi-rs/canvas(原生模块,安装时自动拉取对应平台二进制)。

用法

moguan-pdf <命令> [参数] -o <输出>

| 命令 | 说明 | |---|---| | merge <a.pdf> <b.pdf> … | 合并多个 PDF | | rotate <in> <90\|180\|270> [页码] | 旋转(可指定页码,如 1-3,5) | | extract <in> <页码> | 提取指定页为新 PDF | | delete <in> <页码> | 删除指定页 | | reorder <in> <顺序> | 按 0-based 顺序重排,如 2,0,1 | | pagenum <in> [--pos] [--total] | 加页码 | | bates <in> [--prefix --suffix --start --digits] | Bates 连续编号 | | img2pdf <img…> [--a4] | 图片转 PDF | | idcard <正面> [反面] [--margin --gap] | 证件图排版为 A4 合规 PDF | | text <in> / md <in> | 提取纯文本 / Markdown | | toimg <in> [--fmt --res --zip] | 逐页转图片(--zip 打包) | | longimg <in> [--fmt] | 拼接为一张长图 | | compress <in> | 压缩(结构 / 栅格重建) | | watermark <in> <文字> [--opacity] | 加文字水印 | | crop <in> [--auto \| --margins] | 裁边(--auto 自动去白边) | | rmblank <in> | 删除空白页 | | ocr <in> [--lang --max] [--searchable out.pdf] | 本地 OCR(离线、自托管模型);--searchable 另存双层可搜索 PDF(原页原样 + 隐形文字层,可搜索可复制) |

各命令 -o/--out 指定输出。完整参数见 moguan-pdf <命令> --help

示例

moguan-pdf merge a.pdf b.pdf -o out.pdf
moguan-pdf toimg doc.pdf --zip --fmt jpeg -o pages.zip
moguan-pdf ocr scan.pdf --lang chi_sim+eng -o scan.txt
moguan-pdf ocr scan.pdf --searchable scan-searchable.pdf -o scan.txt  # 扫描件 → 可搜索 PDF
moguan-pdf watermark contract.pdf "仅供核验" -o wm.pdf

隐私

所有处理都在你本机完成,文件不出设备、不上传任何服务器。OCR 用自托管模型离线识别。

许可

MIT © 墨观 MoGuan(moguanpdf.com)