Closed aryanshridhar closed 2 years ago
This commit essentially adds the functionality for allowing users to pass a callback function to -
callback
Installer.install
Installer.ensureDownloaded
which is triggered when an electron binary is being downloaded.
import { Installer, ProgressObject } from 'fiddle-core'; const installer = new Installer(); const callback = (progress: ProgressObject) => { const percent = progress.percent * 100; console.log(`Current download progress %: ${percent.toFixed(2)}`); }; await installer.ensureDownloaded('12.0.15', callback); // OR await installer.install('12.0.15', callback);
(Opening a new pr with the support for downloading from a specific mirror as well along with this)
This commit essentially adds the functionality for allowing users to pass a
callback
function to -Installer.install
Installer.ensureDownloaded
which is triggered when an electron binary is being downloaded.
Usage -