From a6779f4ed41b79a17fce5abc22531acc1547f0dc Mon Sep 17 00:00:00 2001 From: Kyle Kirby Date: Tue, 1 Oct 2013 13:09:45 -0500 Subject: [PATCH] Fixed a bug where the resulting data would be blank. Changed the exit event to be 'close' since 'exit' can be sent even though the stdio streams are still open. The alternative is to use the 'close' event which is emitted when all stdio streams are closed and the program has exited. --- htmltidy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htmltidy.js b/htmltidy.js index 6e501da..3d8c865 100644 --- a/htmltidy.js +++ b/htmltidy.js @@ -46,7 +46,7 @@ function TidyWorker(opts) { this._worker.stderr.on('data', function (data) { errors+= data; }); - this._worker.on('exit', function (code) { + this._worker.on('close', function (code) { switch(code){ // If there were any warnings or errors from Tiny command case TIDY_WARN: