backend-smith
Version:
A CLI tool for automating backend component generation in Express.js, including modules, schemas, routes, services, and more.
15 lines (13 loc) • 457 B
text/typescript
import fs from 'fs';
import { getAbsolutePath } from "./getAbsolutePath";
import logger from '../lib/logger';
export const createFolderHeplder = (module: string) => {
const folderPath = getAbsolutePath(module)
// Check if the folder already exists
if (!fs.existsSync(folderPath)) {
fs.mkdirSync(folderPath);
logger.info(`Module created: ${module}`);
} else {
logger.warn(`Module already exists: ${module}`);
}
}