Refactors file stat to use async API

Updates file stat operation to use the asynchronous API
to prevent blocking the event loop during file system operations.

This improves the responsiveness of the application, especially
when dealing with potentially slow or numerous file system accesses.
This commit is contained in:
AlexKucera committed 2025-09-04 15:03:43 +02:00
1 parent b255b6354e
commit 557a0675be
1 file changed
+1 -1
+1 -1
View File
@@ -308,7 +308,7 @@ export class PandocTypstConverter {
let stat;
try {
stat = fs.statSync(itemPath);
stat = await fsPromises.stat(itemPath);
} catch (error) {
// File might have been deleted between readdirSync and statSync
console.warn(`Export: Unable to stat ${itemPath}:`, error.message);