node-fast-download
node-fast-download copied to clipboard
stop download programatically
How can I stop download programatically ? And is there a way to pause/resume download ?
@karmac2015 You can call the (undocumented) dl.abort()
method to stop the download.
To resume it, if this package is saving to a file for you (i.e. using the destFile
option) then you can create another FastDownload object with the resumeFile
option set to true
. Otherwise (if not using destFile
option) you would have to create another FastDownload object with the start
option set to where the last one left off.
Unfortunately there is currently no way to pause and then resume with the same FastDownload object. It should be possible though, if you are inclined to make a PR. If you are, let me know and I can provide some additional guidance.