MCPcopy Create free account
hub / github.com/mlco2/codecarbon / downloadFile

Function downloadFile

webapp/src/utils/export.ts:176–187  ·  view source on GitHub ↗

* Helper function to download a file

(blob: Blob, filename: string)

Source from the content-addressed store, hash-verified

174 * Helper function to download a file
175 */
176function downloadFile(blob: Blob, filename: string): void {
177 const link = document.createElement("a");
178 const url = URL.createObjectURL(blob);
179
180 link.setAttribute("href", url);
181 link.setAttribute("download", filename);
182 link.style.visibility = "hidden";
183
184 document.body.appendChild(link);
185 link.click();
186 document.body.removeChild(link);
187}

Callers 4

exportToJsonFunction · 0.85
exportExperimentsToCsvFunction · 0.85
exportRunsToCsvFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…