Package Exports
- node-wget-promise
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-wget-promise) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
node-wget-promise
node-wget-promise simplifies retrieving files from any URL, with Promise support.
This package is forked and enhanced from wget-improved
Install
npm install node-wget-promise --save
Example
Basic
var wget = require('node-wget-promise');
var src = 'http://nodejs.org/images/logo.svg';
var options = {
onStart: [Callback],
onProgress: [Callback],
output: [outputFilePath]
};
wget(src, options)
.then(metadata => [fileMetadata])
.catch(err => [Error]);
Simplfied
var wget = require('node-wget-promise');
wget('http://nodejs.org/images/logo.svg');
with Async-Await
var wget = require('node-wget-promise');
(async () => {
await wget('http://nodejs.org/images/logo.svg');
console.log('Done');
})();