@nasriya/overwatch
Advanced tools
@@ -33,3 +33,13 @@ "use strict"; | ||
| const filePath = path_1.default.join(path_, file.name); | ||
| const stats = await fs_1.default.promises.stat(filePath); | ||
| let stats; | ||
| try { | ||
| stats = await fs_1.default.promises.stat(filePath); | ||
| } | ||
| catch (error) { | ||
| if (error.code === 'ENOENT') { | ||
| // File disappeared, skip it safely | ||
| continue; | ||
| } | ||
| throw error; | ||
| } | ||
| const watchedFile = { | ||
@@ -45,3 +55,13 @@ path: filePath, | ||
| const folderPath = path_1.default.join(path_, folder.name); | ||
| const stats = await fs_1.default.promises.stat(folderPath); | ||
| let stats; | ||
| try { | ||
| stats = await fs_1.default.promises.stat(folderPath); | ||
| } | ||
| catch (error) { | ||
| if (error.code === 'ENOENT') { | ||
| // Folder disappeared, skip it safely | ||
| continue; | ||
| } | ||
| throw error; | ||
| } | ||
| const watchedFolder = { | ||
@@ -48,0 +68,0 @@ path: folderPath, |
@@ -28,3 +28,13 @@ import fs from 'fs'; | ||
| const filePath = path.join(path_, file.name); | ||
| const stats = await fs.promises.stat(filePath); | ||
| let stats; | ||
| try { | ||
| stats = await fs.promises.stat(filePath); | ||
| } | ||
| catch (error) { | ||
| if (error.code === 'ENOENT') { | ||
| // File disappeared, skip it safely | ||
| continue; | ||
| } | ||
| throw error; | ||
| } | ||
| const watchedFile = { | ||
@@ -40,3 +50,13 @@ path: filePath, | ||
| const folderPath = path.join(path_, folder.name); | ||
| const stats = await fs.promises.stat(folderPath); | ||
| let stats; | ||
| try { | ||
| stats = await fs.promises.stat(folderPath); | ||
| } | ||
| catch (error) { | ||
| if (error.code === 'ENOENT') { | ||
| // Folder disappeared, skip it safely | ||
| continue; | ||
| } | ||
| throw error; | ||
| } | ||
| const watchedFolder = { | ||
@@ -43,0 +63,0 @@ path: folderPath, |
+1
-1
| { | ||
| "name": "@nasriya/overwatch", | ||
| "version": "1.1.2", | ||
| "version": "1.1.3", | ||
| "description": "A high-performance, dependency-free file system watcher that monitors file and directory changes efficiently across platforms.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
117998
1.08%2552
1.59%