(filename: string, data: Uint8Array)
| 54 | * ``` |
| 55 | */ |
| 56 | export async function saveOutput(filename: string, data: Uint8Array): Promise<string> { |
| 57 | const fullPath = join(OUTPUT_PATH, filename); |
| 58 | |
| 59 | // Ensure directory exists |
| 60 | await mkdir(dirname(fullPath), { recursive: true }); |
| 61 | |
| 62 | // Write the file |
| 63 | await writeFile(fullPath, data); |
| 64 | |
| 65 | return fullPath; |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * Format bytes as a human-readable size string. |