🎉 Add support for progress reporting to library export method

This commit is contained in:
Andrey Antukh 2025-06-04 21:34:47 +02:00
parent 27d2724153
commit 644dd9ff44
4 changed files with 79 additions and 23 deletions

View file

@ -80,7 +80,11 @@ import { Writable } from "stream";
}
{
let result = await penpot.exportAsBytes(context);
const onProgress = (opts) => {
console.log(`Procesing ${opts.item}/${opts.total}: ${opts.path}`);
};
let result = await penpot.exportAsBytes(context, {onProgress});
await writeFile("sample-sync.zip", result);
}