Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A little node module that minimize CSS Files
tree: 10a9875cff

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
tests
.gitignore
README
README.textile
cssmin.js
package.json

README.textile

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

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.

Usage

The module exports the cssmin function, so you can use it with :

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 :

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);
Something went wrong with that request. Please try again.