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

@hayashiii/pdfmint

v1.0.0

Published

Agent-friendly CLI for turning HTML/Markdown drafts into Japanese-typography PDF/PNG deliverables.

Readme

@hayashiii/pdfmint

AIが作ったHTMLまたはMarkdownを、目的に合う日本語書体で提出用PDFへ仕上げるCLIです。確認用PNGも同じ入力から生成できます。

特徴

  • 入口は pdfmint <input> <output> の1つだけ
  • HTML / Markdown → PDF
  • 日本語4書体をローカル同梱し、オフラインでも同じ見た目
  • PDFと確認用PNGを同時生成
  • ページ数検証と構造化エラー
  • --json でAIエージェントから扱いやすい出力

インストール

npm install -g @hayashiii/pdfmint

Node.js 22以上が必要です。Puppeteerが使用するChromeを取得できない場合は、エラーJSONの next_command を実行してください。

使い方

pdfmint report.md report.pdf --json
pdfmint proposal.md proposal.pdf --font shippori --json
pdfmint notice.md notice.pdf --font kiwi --png notice.png --json
pdfmint document.html document.pdf --format A4 --margin 18mm --json

日本語フォント

| ID | 書体 | 向いている文書 | |---|---|---| | zen | Zen Kaku Gothic New | 実務文書、表、仕様書(既定) | | shippori | Shippori Mincho | 提案書、報告書、正式文書 | | kiwi | Kiwi Maru | 案内、親しみのある資料 | | klee | Klee One | 手紙、柔らかい一枚もの |

pdfmint input.md output.pdf --font zen
pdfmint input.md output.pdf --font shippori
pdfmint input.md output.pdf --font kiwi
pdfmint input.md output.pdf --font klee

各書体は実ウェイトを含めてパッケージへ同梱しています。実行時にGoogle Fontsへ接続しません。フォント選択はMarkdown入力に適用され、HTML入力はHTML自身のCSSを尊重します。

オプション

| オプション | 説明 | |---|---| | --json | stdoutへJSONを出力 | | --font <zen\|shippori\|kiwi\|klee> | Markdownの日本語書体(既定: zen) | | --css <file.css> | Markdownの既定スタイルへCSSを追加 | | --format <A4\|A3\|Letter\|Legal> | 用紙サイズ(既定: A4) | | --margin <value> | 余白。例: 18mm、1in、0 | | --landscape | 横向き | | --no-background | CSS背景を無効化 | | --png <output.png> | 確認用PNGも生成 | | --viewport <WxH> | PNG viewport(既定: 1055x1491) | | --scale <number> | PNG scale(既定: 3) | | --expect-pages <number> | PDFページ数が異なれば失敗 |

--css は既定組版の後ろへ追加されるため、見出し・色・余白などを案件ごとに上書きできます。

JSON出力

{
  "success": true,
  "input": "/abs/report.md",
  "output": "/abs/report.pdf",
  "format": "A4",
  "font": "shippori",
  "size_bytes": 482741,
  "page_count": 3,
  "duration_ms": 1234
}

失敗時:

{
  "success": false,
  "error": {
    "code": "PAGE_COUNT_MISMATCH",
    "message": "...",
    "hint": "..."
  }
}

stdoutには最終結果だけを出します。エージェントから実行するときは常に --json を付けてください。

Markdown

GFMに加えて、以下をそのまま扱えます。

  • 先頭frontmatterの除去と title: の反映
  • 脚注
  • GitHub形式のcallout
  • コードのシンタックスハイライト
  • 表の左右・中央揃え
  • 長いコード行の折り返し

注意

  • HTML入力の見た目はHTML内のCSSが正本です。--font と --css はMarkdown入力向けです。
  • HTML内の画像や外部資産は絶対パスまたは data: URLを推奨します。
  • 1ページ物は --expect-pages 1 で意図しない改ページを検出できます。
  • フォントはSIL Open Font License 1.1です。各ライセンスを dist/fonts/ に同梱します。

開発

bun install
bun run typecheck
bun test
bun run build
bun run pack:smoke

License

MIT © 2026 Hayashi