Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

pig-downloader

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()

Install

npm i pig-downloader

DownloadsWeekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

18.9 kB

Total Files

8

Last publish

Collaborators

  • avatar