pig-downloader
A Multithread Downloader for NodeJS
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()