wget-improved
Advanced tools
Comparing version 1.4.0 to 1.5.0
@@ -45,2 +45,3 @@ 'use strict' | ||
proxy: options?options.proxy:undefined, | ||
auth: options.auth?options.auth:undefined, | ||
method: 'GET' | ||
@@ -47,0 +48,0 @@ }, function(res) { |
{ | ||
"name": "wget-improved", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "wget in nodejs, forked from wuchengwei/node-wget to add improvements and help maintain the project", | ||
"keywords": ["download", "http", "https", "ftp", "proxy", "wget"], | ||
"keywords": [ | ||
"download", | ||
"http", | ||
"https", | ||
"ftp", | ||
"proxy", | ||
"wget" | ||
], | ||
"author": "Michael Barajas <michael.a.barajas@gmail.com>", | ||
"repository":{ | ||
"repository": { | ||
"type": "git", | ||
@@ -24,3 +31,10 @@ "url": "git://github.com/bearjaws/node-wget.git" | ||
}, | ||
"engines": { "node": ">= 0.6.18" } | ||
"engines": { | ||
"node": ">= 0.6.18" | ||
}, | ||
"license": "MIT", | ||
"devDependencies": { | ||
"chai": "^4.0.2", | ||
"mocha": "^3.4.2" | ||
} | ||
} |
@@ -1,18 +0,30 @@ | ||
var wget = require('../lib/wget'); | ||
let wget = require('../lib/wget'); | ||
let expect = require('chai').expect; | ||
var download = wget.download('https://www.npmjs.com/static/images/npm-logo.svg', '/tmp/README.md'); | ||
// with a proxy: | ||
// var download = wget.download('https://raw.github.com/Fyrd/caniuse/master/data.json', '/tmp/README.md', {proxy: 'http://proxyhost:port'}); | ||
download.on('error', function(err) { | ||
console.log(err); | ||
}); | ||
download.on('start', function(fileSize) { | ||
console.log(fileSize); | ||
}); | ||
download.on('end', function(output) { | ||
console.log(output); | ||
process.exit(); | ||
}); | ||
download.on('progress', function(progress) { | ||
console.log(progress); | ||
describe("Download Tests", function() { | ||
// with a proxy: | ||
it("Should be able to download the NPM logo", function(done) { | ||
let download = wget.download('https://www.npmjs.com/static/images/npm-logo.svg', '/tmp/npm-logo.svg'); | ||
// @todo upgrade these tests to use a more consistent environment, with its own http server and files. | ||
download.on('error', function(err) { | ||
console.log(err); | ||
expect(err).to.be.null; | ||
done(); | ||
}); | ||
download.on('start', function(fileSize) { | ||
expect(fileSize).to.be.a('string'); | ||
fileSize = Number(fileSize); | ||
expect(fileSize).to.be.above(200); | ||
expect(fileSize).to.be.below(500); | ||
}); | ||
download.on('end', function(output) { | ||
expect(output).to.equal('Finished writing to disk'); | ||
done(); | ||
process.exit(); | ||
}); | ||
download.on('progress', function(progress) { | ||
expect(progress).to.be.above(0); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13997
220
2