Gathering detailed insights and metrics for electron-dl
Gathering detailed insights and metrics for electron-dl
Gathering detailed insights and metrics for electron-dl
Gathering detailed insights and metrics for electron-dl
electron-dl-manager
A library for implementing file downloads in Electron with 'save as' dialog and id support.
electron-dl-downloader
Electron app simple and easy to use download manager, support for multiple downloads.Electron应用简单和易用的下载管理,支持多任务下载
electron-symbol-dl
downloads an electron release symbol zip
animetwist-dl-electron
an electron anime downloader from twist.moe, using twist-dl and youtube-dl
npm install electron-dl
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (93.3%)
HTML (6.7%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
1,192 Stars
107 Commits
140 Forks
18 Watchers
2 Branches
34 Contributors
Updated on Jul 12, 2025
Latest Version
4.0.0
Package Id
electron-dl@4.0.0
Unpacked Size
18.12 kB
Size
5.60 kB
File Count
5
NPM Version
10.6.0
Node Version
18.20.2
Published on
May 01, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
3
Simplified file downloads for your Electron app
1npm install electron-dl
Requires Electron 30 or later.
This is probably what you want for your app.
1import {app, BrowserWindow} from 'electron'; 2import electronDl from 'electron-dl'; 3 4electronDl(); 5 6let mainWindow; 7(async () => { 8 await app.whenReady(); 9 mainWindow = new BrowserWindow(); 10})();
This can be useful if you need download functionality in a reusable module.
1import {BrowserWindow, ipcMain} from 'electron'; 2import {download, CancelError} from 'electron-dl'; 3 4ipcMain.on('download-button', async (event, {url}) => { 5 const win = BrowserWindow.getFocusedWindow(); 6 try { 7 console.log(await download(win, url)); 8 } catch (error) { 9 if (error instanceof CancelError) { 10 console.info('item.cancel() was called'); 11 } else { 12 console.error(error); 13 } 14 } 15});
It can only be used in the main process.
Type: BrowserWindow | WebContentsView
The window to register the behavior on. Alternatively, a WebContentsView
can be passed.
Type: string
The URL to download.
Type: object
Type: boolean
Default: false
Show a Save As…
dialog instead of downloading immediately.
Note: Only use this option when strictly necessary. Downloading directly without a prompt is a much better user experience.
Type: string
Default: User's downloads directory
The directory to save the file in.
Must be an absolute path.
Type: string
Default: downloadItem.getFilename()
Name of the saved file.
This option only makes sense for electronDl.download()
.
Type: string
Default: 'Download Error'
Title of the error dialog. Can be customized for localization.
Note: Error dialog will not be shown in electronDl.download()
. Please handle error manually.
Type: string
Default: 'The download of {filename} was interrupted'
Message of the error dialog. {filename}
is replaced with the name of the actual file. Can be customized for localization.
Note: Error dialog will not be shown in electronDl.download()
. Please handle error manually.
Type: Function
Optional callback that receives the download item.
You can use this for advanced handling such as canceling the item like item.cancel()
which will throw electronDl.CancelError
from the electronDl.download()
method.
Type: Function
Optional callback that receives an object containing information about the progress of the current download item.
1{ 2 percent: 0.1, 3 transferredBytes: 100, 4 totalBytes: 1000 5}
Type: Function
Optional callback that receives an object containing information about the combined progress of all download items done within any registered window.
Each time a new download is started, the next callback will include it. The progress percentage could therefore become smaller again. This callback provides the same data that is used for the progress bar on the app icon.
1{ 2 percent: 0.1, 3 transferredBytes: 100, 4 totalBytes: 1000 5}
Type: Function
Optional callback that receives the download item for which the download has been cancelled.
Type: Function
Optional callback that receives an object with information about an item that has been completed. It is called for each completed item.
1{ 2 filename: 'file.zip', 3 path: '/path/file.zip', 4 fileSize: 503320, 5 mimeType: 'application/zip', 6 url: 'https://example.com/file.zip' 7}
Type: boolean
Default: false
Reveal the downloaded file in the system file manager, and if possible, select the file.
Type: boolean
Default: true
Show a file count badge on the macOS/Linux dock/taskbar icon when a download is in progress.
Type: boolean
Default: true
Show a progress bar on the dock/taskbar icon when a download is in progress.
Type: boolean
Default: false
Allow downloaded files to overwrite files with the same name in the directory they are saved to.
The default behavior is to append a number to the filename.
Type: SaveDialogOptions
Default: {}
Customize the save dialog.
If defaultPath
is not explicity defined, a default value is assigned based on the file path.
After making changes, run the automated tests:
1npm test
And before submitting a pull request, run the manual tests to manually verify that everything works:
1npm start
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 14/30 approved changesets -- score normalized to 4
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More