This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 400,000 packages pre-installed, including
cssmin with all
npm packages installed. Try it out:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
You can either download the plugin and unzip it into to your project folder or you can use npm to install the cssmin package.
npm -g i cssmin
The module exports the cssmin function, so you can use it with :
var cssmin = require('cssmin');
The function cssmin takes two arguments :
var puts = require('util').puts, fs = require('fs'), cssmin = require('./cssmin'); var css = fs.readFileSync("/Any/Random/CSS/File.css", encoding='utf8'); var min = cssmin(css); puts(min);
cssmin is released under a "BSD License":http://opensource.org/licenses/bsd-license.php.