codizium-cli
Version:
A CLI tool to scaffold Laravel and Node-based modules with ease.
19 lines (14 loc) • 522 B
JavaScript
const fs = require("fs");
const path = require("path");
function detectProjectType(dir) {
if (fs.existsSync(path.join(dir, "artisan")) || fs.existsSync(path.join(dir, "routes/web.php"))) {
return "laravel";
}
if (fs.existsSync(path.join(dir, "package.json"))) {
const pkg = require(path.join(dir, "package.json"));
if (pkg.dependencies?.next) return "nextjs";
if (pkg.dependencies?.express || pkg.scripts?.start) return "nodejs";
}
return "unknown";
}
module.exports = { detectProjectType };