UNPKG

rgen-cli

Version:

A developer CLI for initializing React projects, managing utilities, and scaffolding components, hooks, pages, layouts, routes, and contexts quickly.

40 lines (39 loc) 1.1 kB
import fs from 'node:fs'; import path from 'node:path'; export function defaults() { const defaults = { base: 'src/', debug: false, model: 'gemini-2.5-flash', useAI: false, }; const reactUtilsPath = path.resolve(process.cwd(), 'rgen-cli.json'); if (fs.existsSync(reactUtilsPath)) { const reactUtilsDefaults = JSON.parse(fs.readFileSync(reactUtilsPath, 'utf8')); /* * Overriding Default debug */ if (reactUtilsDefaults.debug) { defaults.debug = reactUtilsDefaults.debug; } /* * Overriding Default base */ if (reactUtilsDefaults.base) { defaults.base = reactUtilsDefaults.base; } /* * Overriding Default useAI */ if (reactUtilsDefaults.useAI) { defaults.useAI = reactUtilsDefaults.useAI; } /* * Overriding Default model */ if (reactUtilsDefaults.model) { defaults.model = reactUtilsDefaults.model; } } return defaults; }