@navigraph/downloader
v1.1.3
Published
Downloader helper that download files with concurrency and handles network problems gracefully
Downloads
3
Readme
navigraph-downloader
Downloader helper that download files with concurrency and handles network problems gracefully
Example implementation
import Downloader from "./downloader";
Downloader.download({
files: [
{
url: "https://www.aviationweather.gov/adds/dataserver_current/current/metars.cache.csv",
path: "data/",
type: "METAR",
},
{
url: "https://www.aviationweather.gov/adds/dataserver_current/current/tafs.cache.csv",
path: "data/",
type: "TAF",
},
{
url: "https://www.aviationweather.gov/adds/dataserver_current/current/airsigmets.cache.csv",
path: "data/",
type: "SIGMET",
},
],
retries: 3,
concurrency: 50,
backoff: 100,
})
.then((downloadedFiles) => {
console.log(downloadedFiles);
})
.catch((error) => {
console.log(error.message);
});