Registry / serialization / posthtml-cli

posthtml-cli

JSON →
library0.10.0jsnpmunverified

Command-line interface for PostHTML, a tool for transforming HTML/XML with plugins. Current stable version is 0.10.0, with releases roughly every few months. It supports processing multiple files, glob patterns, custom config files (JSON/JS), and built-in notifications for updates. Compared to alternatives like html-postcss or custom scripts, posthtml-cli provides a simple CLI with plugin loading and file watching. Requires Node >=10. Currently in maintenance mode with no major recent activity.

npm install posthtml-cli
INSTALL
IMPORT
SIG · POSTHTML-CLI
P
posthtml-cli
serializationjavascriptv0.10.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

posthtml-cli (binary)
npx posthtml-cli --help
posthtml --help
The binary is called 'posthtml-cli' to avoid confusion with the posthtml package. Use npx or global install.
not applicable (CLI only)
posthtml-cli [options] <files>
posthtml [options] <files>
No programmatic API, only CLI usage.

Install globally, process HTML files with plugins defined in config.

npm install -g posthtml-cli # Process a single file echo '<div class="hello">Hi</div>' > input.html posthtml-cli -i input.html -o output.html # Process multiple files with a glob posthtml-cli 'src/**/*.html' -d dist # Use a config file (.posthtmlrc.js) echo 'module.exports = { plugins: { "posthtml-include": {} } }' > .posthtmlrc.js posthtml-cli -i src/index.html -o dist/index.html
posthtml --version
Debug
Known issues
breakingv0.9.0: Changed behavior of config loading - now supports async config files
fix
If using a config function that returns a promise, ensure compatibility; previously only synchronous was supported.
affects: >=0.9.0
deprecatedv0.8.0: Option --all-in-output replaced with --all-in-out
fix
Use --all-in-out instead of --all-in-output.
affects: >=0.8.0
gotchaGlob patterns on Windows may need escaped or use forward slashes
fix
Use forward slashes or double backslashes in glob patterns on Windows.
affects: >=0.7.6
gotchaPlugin ordering: CLI and config files may combine in unexpected order
fix
Check documentation for plugin order precedence (CLI overrides config?).
affects: >=0.7.4
Errors
Common errors & fixes
posthtml-cli: command not found
posthtml-cli not installed globally or in PATH
fix
Run npm install -g posthtml-cli or use npx posthtml-cli.
Error: No files matched the given pattern
Glob pattern didn't match any files (e.g., missing file extension or wrong path)
fix
Check the pattern: use 'src/**/*.html' for all HTML files in src/
Error: Cannot find module 'posthtml-load-config'
Missing peer dependency posthtml-load-config when using a config file
fix
Install posthtml-load-config: npm install posthtml-load-config --save-dev
Upgrade
Version history
0.10.0latest on npm
Audit
Dependencies
posthtmlrequiredcore library for HTML transformations
posthtml-load-configoptionalloads plugin configuration from .posthtmlrc or similar
update-notifieroptionalnotifies users of available updates
Agent activity
15 hits · last 30 days
node
12
Amazon
1
Resources
posthtml-cli — npm install posthtml-cli · libregistry