UNPKG

create-express-minco

Version:

A modern Express.js project generator with TailwindCSS, EJS, ESModules, and JWT auth.

31 lines (25 loc) • 1.05 kB
#!/usr/bin/env node import fs from 'fs'; import path from 'path'; import { fileURLToPath } from 'url'; import { execSync } from 'child_process'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); const targetDir = process.argv[2] || 'my-express-backend'; const templateDir = path.join(__dirname, 'express-minco'); if (fs.existsSync(targetDir)) { console.error(`āŒ Folder "${targetDir}" already exists. Choose a different name.`); process.exit(1); } console.log(`šŸ“ Creating project in: ${targetDir}...`); fs.cpSync(templateDir, targetDir, { recursive: true, }); console.log('šŸ“¦ Installing dependencies...'); execSync('npm install', { cwd: targetDir, stdio: 'inherit' }); console.log(`\nāœ… Project successfully created in: ${targetDir}\n`); console.log(`šŸ‘‰ Next steps:\n`); console.log(` 1. Move into your project folder:`); console.log(` cd ${targetDir}\n`); console.log(` 2. Start the development server:`); console.log(` npm start\n`); console.log(`šŸš€ Happy coding!`);