Skip to content
This repository has been archived by the owner on Jun 18, 2023. It is now read-only.

Commit

Permalink
add library
Browse files Browse the repository at this point in the history
  • Loading branch information
fmarcia committed May 20, 2011
1 parent 6816ccc commit 253ed4b
Show file tree
Hide file tree
Showing 6 changed files with 488 additions and 332 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@ Options:
* `--cute-comments` preserves newlines within and around preserved comments; by default, newlines are removed from preserved comments

A [port to javascript](https://github.com/yui/yuicompressor/blob/master/ports/js/cssmin.js) is also available in the YUI Compressor repository.

2 functions are available :

* `processString(content, options)`
* `processFiles(filenames, options)`

See test.js for example.
16 changes: 16 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Port of YUI CSS Compressor from Java to NodeJS
* Author: Franck Marcia - https://github.com/fmarcia
*
* Based on parts of:
* YUI Compressor
* Author: Julien Lecomte - http://www.julienlecomte.net/
* Author: Isaac Schlueter - http://foohack.com/
* Author: Stoyan Stefanov - http://phpied.com/
* Copyright (c) 2009 Yahoo! Inc. All rights reserved.
* The copyrights embodied in the content of this file are licensed
* by Yahoo! Inc. under the BSD (revised) open source license.
*/


module.exports = require('./uglifycss-lib');
17 changes: 17 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name" : "uglifycss",
"author" : {
"name" : "Franck Marcia",
"email" : "franck.marcia@gmail.com",
"url" : "https://github.com/fmarcia"
},
"version" : "0.9",
"main" : "./index.js",
"bin" : {
"uglifycss" : "./uglifycss"
},
"repository": {
"type": "git",
"url": "git@github.com:fmarcia/UglifyCSS.git"
}
}
43 changes: 43 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#! /usr/bin/env node

/*
* UglifyCSS
* Port of YUI CSS Compressor from Java to NodeJS
* Author: Franck Marcia - https://github.com/fmarcia
*
* Based on parts of:
* YUI Compressor
* Author: Julien Lecomte - http://www.julienlecomte.net/
* Author: Isaac Schlueter - http://foohack.com/
* Author: Stoyan Stefanov - http://phpied.com/
* Copyright (c) 2009 Yahoo! Inc. All rights reserved.
* The copyrights embodied in the content of this file are licensed
* by Yahoo! Inc. under the BSD (revised) open source license.
*/


var sys = require('sys'),
uglifycss = require('uglifycss'),
options = {
maxLineLen: 0,
expandVars: false,
cuteComments: true
},
content =
'/*!\n' +
' * UglifyCSS test\n' +
' */\n' +
'.class {\n' +
' font-family : Helvetica Neue, Arial, Helvetica, \'Liberation Sans\', FreeSans, sans-serif;\n' +
' color : #000000;\n' +
' margin: 0 0 0 0;\n' +
' font-size : 12px;\n' +
' font-weight :bold;\n' +
' padding : 5px;\n' +
' position : absolute;\n' +
' z-index : 100000;\n' +
'}\n';


sys.print(uglifycss.processString(content, options) + '\n');
//uglifycss.processFiles(filenames, options) + '\n');
Loading

0 comments on commit 253ed4b

Please sign in to comment.