Generator based, co/koa compatible file(s) downloader
npm i -S rain-util-download
const download = require('rain-util-download');
cosnt img = {
url: url of file you wish to download,
src: tentative filename on local system
}
const downloadedImagePath = yield download({
url: 'https://www.npmjs.com/static/images/npm-logo.svg',
src: (path.resolve('./npm-logo.svg'))
})
also works when supplied an array