file-downloadr

1.0.3 • Public • Published

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

Package Sidebar

Install

npm i file-downloadr

Weekly Downloads

4

Version

1.0.3

License

MIT

Unpacked Size

45.2 kB

Total Files

5

Last publish

Collaborators

  • saratonite