- Add an FAQ section to
README.md
on how to handle invalid URLs
- Fix issues around starting multiple downloads at the same time.
- No longer need to use
await
before a download call when multiple downloads are started at the same time.
- Added more debug logging
- Added notes to
README.md
thatdownload()
must be called withawait
or weird things happen.
- If you are using Electron >=
30.3.0
, you will get native reporting on download percent and bytes per second via the Electron API instead of manual calculations.- Provided via this Electron PR
Do not emit progress events when pause()
is called.
Adds fixes around DownloadData
population.
Breaking changes
ElectronDownloadManager.download()
is now async
.
This change is necessary to fix a race condition where download()
is called, but if you immediately try to perform an
operation against the returned id, such as pauseDownload()
, the DownloadItem
has not been properly initialized
since the event that populates DownloadItem
is out-of-band.
So the new download()
implementation waits until DownloadItem
is properly initialized before returning the id.
- Fix issue where pausing a download won't pause it
- This can happen if you pause right after starting a download where internally we pause then resume after internal handlers are set. Now we'll track if the user has paused and will not auto-resume after.
- Fix readme. Should be
ElectronDownloadManager
notFileDownloadManager
No actual logic changes.
- Remove postinstall script
- Remove eslint and use biome.js for linting / formatting instead
- Remove unnecessary devDep packages.
- Implement
onDownloadInterrupted()
for the downloadcompleted
state. This should cover urls that result in 404s.- Added new property
interruptedVia
toDownloadData
to indicate the state in which the download was interrupted from.
- Added new property
- Removed the restriction on having to specify
saveAsFilename
since it should auto-calculate the filename from the URL if not provided. - Fixed a bug where
resolvedFilename
was not populated when not using a save as dialog.
- Added some missing instructions for how to format the download rate / estimated time remaining
Added to DownloadData
:
isDownloadResumable()
Added to DownloadData
:
- Add
downloadRateBytesPerSecond
- Add
estimatedTimeRemainingSeconds
See Readme for more information.
- Forgot to build before publishing, added build to prebuild script
- Small readme fix
- Fix documentation formatting
- Add unit tests for utils file
- Downgraded
unused-filename
from4
to3
series due to issue with jest not supporting esmodules well
- Fix bug where
cancelledFromSaveAsDialog
was not being set if the user cancelled from the save as dialog
Fix the TOC in the readme.
Complete refactor to make things more organized and readable. Unit tests are more sane now.
Breaking Changes:
-
showBadge
option has been removed. The reasoning is that you may have other items that you need to include in your badge count outside of download counts, so it's better to manage that aspect yourself. -
The callbacks return a
DownloadData
instance instead of a plain object. The data sent is the same as it was in v1.
- Internal refactors and small fixes
- More immediate download fixes
- Fixes a major issue where a download would not complete if using the save as dialog
- Fixes internal static method
disableThrottle()
where it was not working / throwing
- Fix issues around downloading smaller files where the download would complete before the progress / completed event was emitted
- When the user cancels from the save as dialog, will fire out
onDownloadCancelled()
- Add
cancelledFromSaveAsDialog
in the callback data to indicate if the download was cancelled from the save as dialog
- Add
ElectronDownloadManagerMock
for use in tests - Add
getActiveDownloadCount()
to get the number of active downloads - Add
showBadge
option todownload()
to show a badge on the dock icon
download()
now returns the id
of the download
Readme updates
Initial version