From 84a0dcc6e0fa9fc5a270ac370464fcd52954a9e8 Mon Sep 17 00:00:00 2001 From: mk Date: Sat, 20 Sep 2014 00:09:33 +0200 Subject: [PATCH] fixes #5 uses write instead of append flag --- lib/wget.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/wget.js b/lib/wget.js index 1b55d3e..42af448 100644 --- a/lib/wget.js +++ b/lib/wget.js @@ -33,7 +33,7 @@ function download(src, output, options) { downloadedSize = 0; fileSize = res.headers['content-length']; writeStream = fs.createWriteStream(output, { - flags: 'a', + flags: 'w', encoding: 'binary' }); @@ -144,4 +144,4 @@ function cleanProtocol(str) { } exports.download = download; -exports.request = request; \ No newline at end of file +exports.request = request;