easydownload is a library that helps us:
- Download multiple files
- Get the download's speed
- Parallel downloading
Single file
const {Download} = require('easydownload')
const download = new Download('some url', 'some local path')
download.on('finish', _ => console.log('download is finished'))
download.start()
Multiple file
const {DownloadManager} = require('easydownload')
const manager = new DownloadManager
// Putting the number of file to download simultaneously
manager.simultaneousDownloads = 5 // DEFAULT: 1
manager.addToQueue('some url', 'some local path')
manager.addToQueue('some url', 'some local path')
manager.addToQueue('some url', 'some local path')
manager.on('speed', (speed, avg) => console.log(StreamSpeed.toHuman(avg)))
manager.on('finish', _ => console.log('download is finished'))
manager.start()
Create the manager
Starts the download
Pauses the download to get resumed
Resumes the download
Add a download to the queue
Number of file to download at once
Download
- A Download instance
Download
- A Download instance
Download
- A Download instance
Download
- A Download instance
Error
- A Download instanceDownload
- A Download instance
Number
- Speed at which streams in the group are being read.Number
- Average speed.
Represents a download
Starts the download
Pauses the download to get resumed
Resumes the download
Stops the download, but keeps the file
Destroys the download, and removes the file
stream.Readable
- The received download stream
Buffer
- chunk
Download.STATES: Number
- The current state
Error
- the error