@navigraph/downloader
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

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);
  });

Readme

Keywords

none

Package Sidebar

Install

npm i @navigraph/downloader

Weekly Downloads

0

Version

1.1.3

License

ISC

Unpacked Size

22.3 kB

Total Files

9

Last publish

Collaborators

  • navigraph-bot
  • stephendoc
  • m4rkus
  • skysails