http-chunk-downloader

1.0.5 • Public • Published

I. Introduction

A http-chunk-serve client library which allow download large file into multiple chunk, automatically verify each chunk, merge completed chunks into single file, and retry download if failed.

It's very useful for device which have a bad network connection.

II. Install

npm i http-chunk-downloader<version>

III. Usage

const { download } = require('http-chunk-downloader')
const chunkSize = 1024 * 1024 * 30;
 
(async () => {
  const file = await download('https://abc.xyz/background.png', { 
    retry: 10, 
    chunkSizeInBytes: chunkSize,
    onError: (e, i) => console.log(`Download chunk ${i} exception: ${e.message}`) 
  })
  console.log('Downloaded file', file)
})

Readme

Keywords

none

Package Sidebar

Install

npm i http-chunk-downloader

Weekly Downloads

2

Version

1.0.5

License

ISC

Unpacked Size

7.16 kB

Total Files

4

Last publish

Collaborators

  • vutrongthinhk7