r/usefulscripts • u/MadBoyEvo • Aug 11 '19
[PowerShell] Formatting and minifying resources (HTML, CSS, JavaScript)
So I was wondering on Friday if I can format my HTML produced by PSWriteHTML module. Turns out it's quite possible. After some busy Saturday/Sunday please welcome PSParseHTML module.
How to https://evotec.xyz/formatting-and-minifying-resources-html-css-javascript-with-powershell/
Github Sources: https://github.com/EvotecIT/PSParseHTML
I am not sure how useful it will be outside of a few specific cases but I needed it for my own curiosity, I may as well share this.
It has 7 functions:
Optimize-CSS
Optimize-HTML
Optimize-JavaScript
Format-CSS
Format-HTML
Format-JavaScript
Convert-HTMLToText
Generally speaking it can format CSS/HTML/JS or minify those. Also it can extract text from HTML code.
Enjoy ;-)