Permalink
Browse files

Bin file

  • Loading branch information...
1 parent 5bda079 commit ebce9b37a74f85aea1a629e989599d0b33b5912d @yuanyan committed Nov 25, 2013
Showing with 21 additions and 0 deletions.
  1. +21 −0 bin/optimage
View
@@ -0,0 +1,21 @@
+#!/usr/bin/env node
+'use strict';
+
+var optimage = require('../');
+var argv = process.argv;
+
+var options = {
+ inputFile: argv[3],
+ outputFile: argv[4]
+};
+
+optimage(options, function(err, res){
+ var saved = res.saved;
+ var stderr = res.stderr;
+
+ if (stderr.indexOf('already optimized') !== -1 || saved < 10) {
+ console.log(options.inputFile, "(already optimized)", ">", outputFile);
+ }else{
+ console.log(options.inputFile, "(saved "+ saved+ "Bytes)", ">", outputFile);
+ }
+})

0 comments on commit ebce9b3

Please sign in to comment.