@fireenjin/cli
Version:
A set of tools for speeding up production of full-stack Firebase projects.
19 lines (17 loc) • 432 B
text/typescript
import fs from "fs";
export default async function readFilesToArray(
dir: string,
{ withFileTypes }: { withFileTypes?: boolean } = {}
) {
try {
let files: any[] = [];
fs.readdirSync(dir, { withFileTypes } as any).forEach((file) => {
console.log(file);
files.push(file);
});
return files;
} catch (error) {
console.log("No template partials found.");
return null;
}
}