0.0.1 • Published 4 years ago

@mnesia/dl-file v0.0.1

Weekly downloads
2
License
-
Repository
github
Last release
4 years ago

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