@felixrieseberg/nugget
Advanced tools
Comparing version 2.0.2 to 2.1.0
@@ -41,6 +41,7 @@ var request = require('request') | ||
urls.forEach(function (url) { | ||
urls.forEach(function (url, index) { | ||
debug('start dl', url) | ||
pending++ | ||
var dl = startDownload(url, opts, function done (err) { | ||
var outputName = opts && opts.targetNames ? opts.targetNames[i] : undefined | ||
var dl = startDownload(url, opts, outputName, function done (err) { | ||
debug('done dl', url, pending) | ||
@@ -115,4 +116,4 @@ if (err) { | ||
function startDownload (url, opts, cb) { | ||
var targetName = path.basename(url).split('?')[0] | ||
function startDownload (url, opts, outputName, cb) { | ||
var targetName = outputName || path.basename(url).split('?')[0] | ||
if (opts.singleTarget && opts.target) targetName = opts.target | ||
@@ -119,0 +120,0 @@ var target = path.resolve(opts.dir || process.cwd(), targetName) |
{ | ||
"name": "@felixrieseberg/nugget", | ||
"version": "2.0.2", | ||
"version": "2.1.0", | ||
"description": "minimalist wget clone written in node. HTTP GETs a file and saves it to the current working directory", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
42765
282