ConceptCreator/app/storage/FileUtils.ts

14 lines
323 B
TypeScript
Raw Normal View History

2024-03-20 09:26:14 +01:00
import * as fs from "fs";
import * as path from "node:path";
export class FileUtils {
public static listFilesInDirectory(directory: string) {
if(fs.lstatSync(directory).isDirectory()) {
return fs.readdirSync(directory).map(fileName => path.join(directory, fileName))
} else {
return [];
}
}
}