From cd765b40d66aff966332854aeafb50e7bf0c40d5 Mon Sep 17 00:00:00 2001 From: "pje@telecommunity.com" Date: Thu, 22 May 2014 19:19:07 -0400 Subject: [PATCH] Fix sporadic truncation of output files --- htmltidy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 htmltidy.js diff --git a/htmltidy.js b/htmltidy.js old mode 100644 new mode 100755 index 6e501da..d45fa1e --- a/htmltidy.js +++ b/htmltidy.js @@ -127,7 +127,7 @@ function tidy(text, opts, cb) { error+= data; }); worker.on('end', function (code) { - cb(error, result); + setImmediate(function(){cb(error, result);}); }); worker.end(text); }