import fs from 'fs'; export const isDirectory = (file: fs.Dirent) => { return file.isDirectory(); }; export const getSubFolder = (path: string) => { return fs .readdirSync(path, { encoding: 'utf-8', withFileTypes: true, }) .filter(isDirectory); };