From 4298506c2fa6e841a12764bcc67a030472a1df03 Mon Sep 17 00:00:00 2001 From: Alexander Zonov Date: Wed, 12 Feb 2014 12:37:48 +0400 Subject: [PATCH] Fixed #18 --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 78f9bbf..ade6294 100644 --- a/index.js +++ b/index.js @@ -48,13 +48,13 @@ module.exports = function (options) { function write(files, processor, callback) { if (processor) { - var stream = processor; - stream.on('data', callback); + processor.on('data', callback); files.forEach(function(file) { - stream.write(file); + processor.write(file); }); - stream.end(); + + processor.removeListener('data', callback); } else files.forEach(callback);