Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added package.json for npm installations

  • Loading branch information...
commit 5d5e41e3c5b51986c29970d60ebb2cba62c93a08 1 parent cbf181d
@davglass davglass authored
Showing with 41 additions and 0 deletions.
  1. +30 −0 bin/yuicompressor
  2. +11 −0 package.json
View
30 bin/yuicompressor
@@ -0,0 +1,30 @@
+#!/usr/bin/env node
+
+/*
+Just a simple nodejs wrapper around the .jar file
+for easy CLI use
+*/
+
+var spawn = require('child_process').spawn,
+ fs = require('fs'),
+ path = require('path'),
+ args = process.argv.slice(2),
+ lists = fs.readdirSync(path.join(__dirname, '../build'));
+
+lists.some(function(item) {
+ if (path.extname(item) === '.jar') {
+ args.unshift(path.join(__dirname, '../build/', item));
+ return true;
+ }
+});
+
+args.unshift('-jar');
+
+var cmd = spawn('java', args);
+
+cmd.stdout.on('data',function(data) {
+ console.log(data.toString().trim());
+});
+cmd.stderr.on('data',function(data) {
+ console.error(data.toString().trim());
+});
View
11 package.json
@@ -0,0 +1,11 @@
+{
+ "name": "yuicompressor",
+ "description": "Simple install for YUICompressor CLI",
+ "version": "2.4.8pre",
+ "devDependencies": {
+ "yuitest": "*"
+ },
+ "bin": {
+ "yuicompressor": "./bin/yuicompressor"
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.