Skip to content

Commit

Permalink
Make pngquant-bin an optional dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
Munter committed Mar 26, 2014
1 parent 1c6bd26 commit 14bce27
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/PngQuant.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
var childProcess = require('child_process'),
Stream = require('stream').Stream,
util = require('util'),
binPath = require('pngquant-bin').path;
pngQuantBin;

try {
pngQuantBin = require('pngquant-bin');
} catch (e) {}

var binPath = pngQuantBin ? pngQuantBin.path : 'pngquant';

function PngQuant(pngQuantArgs) {
Stream.call(this);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"directories": {
"test": "test"
},
"dependencies": {
"optionalDependencies": {
"pngquant-bin": "=0.1.7"
},
"devDependencies": {
Expand Down

0 comments on commit 14bce27

Please sign in to comment.