Skip to content
This repository was archived by the owner on Jun 9, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## Description

This is a node.js module that minimize CSS files (cssmin).
**It's a fork of [jbleuzen/node-cssmin](https://github.com/jbleuzen/node-cssmin) with ability to generate result in file from cli.**

This is a nodejs 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)

Expand Down
17 changes: 10 additions & 7 deletions bin/cssmin
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,21 @@ function squeeze_out(css_in) {
}

if (arg.length) {
arg = arg[0].replace(/^(-)+/,'');
switch(arg) {
var from = arg[0].replace(/^(-)+/,'');
switch(from) {
case 'h' : showHelp();
break;
case 'help' : showHelp();
break;
default :
fs.readFile( arg, "utf8", function(err, css_in) {
if (err) {
util.puts("Invalid file : "+ arg);
process.exit(1);
}
fs.readFile( from, "utf8", function(err, css_in) {
if (err) {
util.puts("Invalid file : "+ from);
process.exit(1);
}
else if (arg.length > 1){
fs.writeFileSync(arg[1], cssmin(css_in));
}
else {
squeeze_out(css_in);
}
Expand Down
38 changes: 22 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
{
"name": "cssmin",
"version": "0.4.3",
"description": "A simple CSS minifier that uses a port of YUICompressor in JS",
"main": "cssmin",
"bin": {
"cssmin": "./bin/cssmin"
},
"author": {
"name": "Johan Bleuzen",
"url": "http://blog.johanbleuzen.fr"
},
"license": "BSD-2-Clause",
"repository": {
"type": "git",
"url": "http://github.com/jbleuzen/node-cssmin"
}
"name": "cssmin-cli",
"version": "0.0.5",
"description": "A simplest CSS minifier that uses a port of YUICompressor in JS",
"main": "cssmin",
"bin": {
"cssmin": "./bin/cssmin"
},
"author": "Johan Bleuzen (http://blog.johanbleuzen.fr)",
"license": "BSD-2-Clause",
"repository": {
"type": "git",
"url": "https://[email protected]/mixartemev/node-cssmin"
},
"bugs": {
"url": "https://github.com/mixartemev/node-cssmin/issues"
},
"homepage": "https://github.com/mixartemev/node-cssmin#readme",
"dependencies": {},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
}
}