docs: rewrite README to reference-grade - #13
Merged
Conversation
The README covered the tool but read as a feature tour: no badges, no navigation, an API section that showed one example and named none of the exported surface, and nothing for someone hitting an error at 2am. - Badges (npm, downloads, CI, node, types, license) and an npx quick start, so the first thing a reader can do is run it without installing. - Table of contents; the page is now long enough to need one. - Complete CLI reference: every flag with its real default, split into shared/image/video, plus the per-kind concurrency rationale. - Complete Node API reference: every exported function, the options tables, the JobResult union, type guards, progress events, cancellation, and why quality/pixels are branded. - Recipes for the cases people actually have — build script, CI size gate, capability probe before offering a format. - FAQ covering the questions the design provokes: why a file was "skipped", where output went, FFMPEG_NOT_FOUND with ffmpeg installed, why webm rejects H.264, missing .avif/.jxl. - v1 comparison moved below the useful content and folded into migration. Everything here was verified against the source or a real run rather than written from memory. Two claims the old README got wrong are fixed: images already in a modern format keep it instead of being forced to WebP, and `formats` prints the ffmpeg version while only `--json` carries the path. The demo block, JSON sample, and capability numbers are real output. All TypeScript examples typecheck under strict mode against dist/index.d.ts, and the jq one-liners were executed. Docs only — no version bump, no source changes.
CI runs `prettier --check .`, which covers markdown tables and fenced TypeScript blocks. Table padding is normalised and the code samples are reflowed to prettier's output. The JobResult union is now shown as the real source definition — three named payload types — with the per-status fields in a table, rather than the inlined shape prettier expanded to twelve lines. Same information, and it matches src/types/results.ts. Examples re-checked with tsc after reflowing; still clean under strict.
This was referenced Aug 5, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Rewrites
README.mdinto a proper reference. No source changes, no version bump — the README ships infiles, so it reaches npm on the next publish either way.Why
The old README explained the tool well but was structured as a feature tour. It had no badges, no navigation, an API section that showed a single example without naming the exported surface, and nothing to help someone who has just hit an error.
Changes
npxquick start — npm version, downloads, CI, node, types, license. The first thing a reader can do is run it without installing.min(cores, 8)for images,cores / 4for video).JobResultunion, type guards, progress events, cancellation, and the rationale for brandedQuality/Pixels.FFMPEG_NOT_FOUNDwhile ffmpeg is installed, why.webmrejects H.264, why.avif/.jxlmay be missing, whether it works when piped.Two corrections
The previous README had these wrong:
.avifinput stays AVIF (resolveImageFormat,src/core/compress.ts:248).formatsprints the ffmpeg version; onlyformats --jsoncarries the resolved path, invideo.ffmpeg.Verification
Nothing here was written from memory:
imgvidcompress samples --recursivecaptured under a pty.--jsonrun, including thekindfield the old sample omitted.formats --jsonon a stock Homebrew ffmpeg.strictagainstdist/index.d.ts.jqone-liner was executed, including the CI size gate — it correctly exits 1 on an oversized asset.prettier --check README.mdpasses.