Licence
—
Version
0.0.1
Deps
3
Size
6 kB
Vulns
1
Weekly
0
dl-file
Promise based HTTP file downloader
fetch(url, filename)
.then(filename => console.log(`Saved to ${filename}`));
With progress support
function progressFunc(progress) {
console.log(`Downloaded ${progress.downloadedBytes} of ${progress.totalSize}`);
}
const progressThrottle = 600;
fetch(url, filename, progressFunc, progressThrottle);
progressThrottle determines how often the progressFunc is called, default is 1000ms