Socket
Socket
Sign inDemoInstall

@navigraph/downloader

Package Overview
Dependencies
6
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @navigraph/downloader

Downloader helper that download files with concurrency and handles network problems gracefully


Version published
Weekly downloads
7
increased by600%
Maintainers
3
Created
Weekly downloads
 

Readme

Source

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

FAQs

Last updated on 26 Oct 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc