← Back
Webpage Compressor
CLI tool to compress HTML by removing metadata, scripts, and styles.
A CLI tool to compress HTML by removing scripts, styles, and extra whitespace.
Installation
To use this tool anywhere on your system:
- Build the project:
pnpm run build - Link or install globally:
pnpm add -g .
Usage
compress-html [input-html-file] [output-html-file]
- No arguments:
- Tries to read HTML from your clipboard.
- If the clipboard is empty or doesn't look like HTML, it prompts you for a file path.
- Result is copied back to the clipboard.
- One argument (
<input>):- Reads from the file and copies the result to the clipboard.
- Two arguments (
<input> <output>):- Reads from the input file and writes to the output file.
Development
To run locally without installing:
npx tsx compress-html.ts [input] [output]