node-fast-download icon indicating copy to clipboard operation
node-fast-download copied to clipboard

stop download programatically

Open karmac2015 opened this issue 5 years ago • 1 comments

How can I stop download programatically ? And is there a way to pause/resume download ?

karmac2015 avatar Nov 07 '18 21:11 karmac2015

@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.

zenflow avatar Nov 07 '18 22:11 zenflow