forked from jbleuzen/node-cssmin
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CLI interface, fill out package.json, bump version number
- Loading branch information
Felipe Gasper
authored and
Felipe Gasper
committed
Nov 4, 2011
1 parent
4e36377
commit b619aa5
Showing
3 changed files
with
38 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1 +1,2 @@ | |||
node-cssmin.esproj | node-cssmin.esproj | ||
.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,26 @@ | |||
#!/usr/bin/env node | |||
// -*- js -*- | |||
|
|||
var args = process.argv.slice(2); | |||
|
|||
function squeeze_out(css_in) { | |||
process.stdout.write( require("cssmin").cssmin(css_in) ); | |||
} | |||
|
|||
if (args.length) { | |||
require("fs").readFile( args[0], "utf8", function(err, css_in) { | |||
if (err) { | |||
throw err; | |||
} | |||
else { | |||
squeeze_out(css_in); | |||
} | |||
} ); | |||
} | |||
else { | |||
var stdin = process.openStdin(); | |||
stdin.setEncoding("utf8"); | |||
var css_in = ""; | |||
stdin.on("end", function() { squeeze_out(css_in) }); | |||
stdin.on("data", function(chunk) { css_in += chunk }); | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,10 +1,17 @@ | |||
{ | { | ||
"name": "cssmin", | "name": "cssmin", | ||
"version": "0.3.0", | "version": "0.3.1", | ||
"description": "A simple CSS File minifier that uses a port of YUICompressor in JS", | "description": "A simple CSS minifier that uses a port of YUICompressor in JS", | ||
"main": "cssmin", | "main": "cssmin", | ||
"bin": { | |||
"cssmin": "./bin/cssmin" | |||
}, | |||
"author" : { | "author" : { | ||
"name" : "Johan Bleuzen", | "name" : "Johan Bleuzen", | ||
"url" : "http://blog.johanbleuzen.fr" | "url" : "http://blog.johanbleuzen.fr" | ||
} | }, | ||
"repository" : { | |||
"type" : "git", | |||
"url" : "http://github.com/jbleuzen/node-cssmin" | |||
} | |||
} | } |