20 October 2011

Command-line CSS Unminifier Utility

Given the success of my online CSS unminifier, I decided to port it to Node.js and turn it into a server-side utility. The full code for the CSS beautifier can be found on github. It’s light-weight and robust with pretty much the same options as the LessCSS script, and it’s super easy to get started with right away.

Install with NPM

npm install -g cssunminifier

Start unminifying CSS

Save the output to a file:

cssunminifier style.min.css style.css

Print out a file to stdout with a tab width of 8 spaces instead of 4:

cssunminifier -w=8 style.min.css

Read a file from the web and page it with less:

curl http://mrcoles.com/media/css/base/screen.css | cssunminifier - | less

Bonus points for using the last example to make fun of the CSS on my site. For more info, check out the github page.

Post a comment

*
* (never published)
*

* Required fields

Peter Coles

Peter Coles

is a software engineer who lives in NYC, works at Hunch, and blogs here.
More about Peter »

@lethys · github · hunch
tumblr · rss