You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a function where im looping over an array, to do some process this lead to see progress bar appearing in many line rather than show the progress on the same bar.
Could you provide an example how to do so when im using for loop
const bar = new cliProgress.SingleBar({
format: 'Processing |' + chalk.cyan('{bar}') + '| {percentage}% || {value}/{total} Pages || Current File: {filename}',
barCompleteChar: '\u2588',
barIncompleteChar: '\u2591',
hideCursor: true
}, cliProgress.Presets.shades_classic);
bar.start(pages.length, 0, {
filename: 'Starting...'
});
for (const page of pages) {
const pageName = page.FileLeafRef;
// Update the progress bar with the current file name and progress
bar.increment(1, {
filename: pageName
});
const pageContent = page.CanvasContent1;
if (pageContent) {
const cleanedContent = cleanHtml(decodedContent);
const outputPdfPath = `./${path.parse(pageName).name}.pdf`;
await convertHtmlToPdf(cleanedContent, outputPdfPath);
} else {
console.log(chalk.red(`Failed to retrieve content for page: ${pageName}\n`));
}
The text was updated successfully, but these errors were encountered:
I have a function where im looping over an array, to do some process this lead to see progress bar appearing in many line rather than show the progress on the same bar.
Could you provide an example how to do so when im using for loop
The text was updated successfully, but these errors were encountered: