ConceptCreator/app/storage/FileUtils.ts
Sebastian Böckelmann 8016f55e85
Some checks failed
E2E Testing / test (push) Failing after 1m34s
Refactor Loading of ScriptAccounts
2024-03-20 09:26:14 +01:00

14 lines
323 B
TypeScript

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 [];
}
}
}