(filePath, fileArr)
| 13 | } |
| 14 | |
| 15 | static async saveJsonFile(filePath, fileArr) { |
| 16 | try { |
| 17 | // Ensure directory exists |
| 18 | await fs.promises.mkdir(path.dirname(filePath), { recursive: true }); |
| 19 | |
| 20 | let data = await JSON.stringify(fileArr); |
| 21 | await writeFile(filePath, data); |
| 22 | console.log(`Successfully saved file list to ${filePath}.`); |
| 23 | } catch (err) { |
| 24 | console.error(err); |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | static fileExists(filePath) { |
| 29 | return fs.existsSync(filePath); |
nothing calls this directly
no outgoing calls
no test coverage detected