Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add most used functions of cssmin for use as a node.js module #24

Closed
wants to merge 1 commit into from

2 participants

@au-phiware

This is a simple wrapper to achieve one goal: a node module that is forward compatible with future releases of YUICompressor.

This module exposes the entire compressor object as well as the most commonly used cssmin function.

@tml
Collaborator

Thanks for your contribution, but the cssmin.js code has been forked into https://github.com/yui/ycssmin - we will almost certainly be dropping support for it from YUICompressor very soon. This submission should probably move over to the ycssmin project.

@tml tml closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 11 additions and 0 deletions.
  1. +11 −0 ports/js/cssmin.node.js
View
11 ports/js/cssmin.node.js
@@ -0,0 +1,11 @@
+/**
+ * node.js
+ * Author: Corin Lawson - https://github.com/au-phiware
+ * This is a wrapper of cssmin.js, suitable for use in Node.js.
+ * Permission is hereby granted to do what you you see fit.
+ */
+(function() {
+ eval(String(require('fs').readFileSync(__dirname + '/cssmin.js')));
+ exports.compressor = YAHOO.compressor;
+ exports.cssmin = function () { return YAHOO.compressor.cssmin.apply(YAHOO.compressor, arguments); };
+})();
Something went wrong with that request. Please try again.