forked from jbleuzen/node-cssmin
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renaming the file so that it works with tetile
- Loading branch information
jbleuzen
committed
Apr 13, 2011
1 parent
f021238
commit 10a9875
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
h2. Description | ||
|
||
This is a node.js module that minimize CSS files (cssmin). | ||
It uses a port of YUICompressor made in JavaScript by Stoyan Stefanov based on Isaac Schlueter work. | ||
For more informations about YUICompressor -> https://github.com/yui/yuicompressor | ||
|
||
h2. Installation | ||
|
||
You can either download the plugin and unzip it into to your project folder or you can use npm to install the node-cssmin package. | ||
|
||
h2. Usage | ||
|
||
The module exports the cssmin function, so you can use it with : | ||
|
||
pre. var cssmin = require('cssmin').cssmin; | ||
|
||
The function cssmin takes two arguments : | ||
* input : the CSS content you want to minimize. | ||
* linebreakpos : the number of characters before the end of the line. If empty, the output will have only one line. | ||
|
||
Example : | ||
|
||
pre.. var puts = require('sys').puts, | ||
fs = require('fs'), | ||
cssmin = require('./cssmin').cssmin; | ||
|
||
var css = fs.readFileSync("/Any/Random/CSS/File.css", encoding='utf8'); | ||
|
||
var min = cssmin(css); | ||
puts(min); |