UNPKG

testeranto

Version:

the AI powered BDD test framework for typescript projects

17 lines (16 loc) 539 B
import fs from "fs"; import path from "path"; export async function getAllFilesRecursively(directoryPath) { let fileList = []; const files = await fs.readdirSync(directoryPath, { withFileTypes: true }); for (const file of files) { const fullPath = path.join(directoryPath, file.name); if (file.isDirectory()) { fileList = fileList.concat(await getAllFilesRecursively(fullPath)); } else if (file.isFile()) { fileList.push(fullPath); } } return fileList; }