Skip to content

saratonite/file-downloadr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

file-downloadr 🔻

A file downloader package top of request ⚡

Features

  • Support Promise and async/ await 🔥
  • Capture timeout errors ⚡

Installation

npm install file-downloadr

Or

yarn add file-downloadr

Usage

const fdownload = require("file-downloadr");
try {
  fdownload(
    "http://example/big-file.zip",
    "/home/dummy/downloads/big-file.zip",
    options
  );
} catch (e) {
  console.log("!! :( ", e);
}

Or Promise API

const fdownload = require("file-downloadr");

fdownload(
  "http://example/big-file.zip",
  "/home/dummy/downloads/big-file.zip",
  options
)
  .then(res => console.log("File downloaded"))
  .catch(error => console.log("Error downloading file"));

Options

  • method :string - http method (GET, POST..etc)
  • timeout: number - time out in milli-seconds

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published