pig-downloader
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

pig-downloader

A Multithread Downloader for NodeJS

MIT Licence NPM version


Install

npm install --save pig-downloader

Example

import { PigDownloader } from "pig-downloader";
let downloader = new PigDownloader()
let item = downloader.download("DOWNLOAD URL HERE", "./example.file", 16)
item.on(item.events.data, (i) => {
    let parts = item.parts
    let str = "|"
    while (parts != null) {
        str += `${((parts.current - parts.head) * 100 / (parts.end - parts.head)).toFixed(2)}%|`
        parts = parts.next
    }
    console.log(str)
}).on(item.events.complete, () => {
    console.log("complete")
})
item.start()

Readme

Keywords

Package Sidebar

Install

npm i pig-downloader

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

18.9 kB

Total Files

8

Last publish

Collaborators

  • xzzpig