download-directory.github.io
download-directory.github.io copied to clipboard
Separate logic from UI
- Follows #124
I'm imagining an API like:
const download = downloadDirectory('https://github.com/refined-github/sandbox/tree/default-a/.github/workflows');
download.addEventListener('warning', updateStatus); 'retrying…' | 'It’s a large repo…'
download.addEventListener('info', updateStatus);
download.addEventListener('download', updateStatus); // single file downloaded
try {
const files = await download.files;
downloadFile(zip(files))
} catch (error) {
updateStatus(error)
}
This will eventually enable a rewrite into svelte for a better UI