node-wget-promise
v0.1.6
Published
wget in Node, with Promise support
Downloads
4,122
Maintainers
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
Installation
npm install node-wget-promise --save
Usage
The simpliest example
const wget = require('node-wget-promise');
wget('http://nodejs.org/images/logo.svg');
The basic example with callbacks
const wget = require('node-wget-promise');
wget([url], {
onStart: [Callback],
onProgress: [Callback],
output: [outputFilePath]
})
.then(metadata => [fileMetadata])
.catch(err => [Error]);
Work with async-await syntax
const wget = require('node-wget-promise');
(async () => {
await wget([url]);
console.log('Done');
})();