sliceit
Version:
A CLI tool to generate React components with custom templates (JS, JSX, TSX, CSS, SCSS, Styled Components)
15 lines (13 loc) • 354 B
JavaScript
import path from "node:path";
import fs from "node:fs";
export const loadConfig = () => {
const configPath = path.resolve(process.cwd(), "sliceit.config.json");
if (fs.existsSync(configPath)) {
try {
return fs.readFileSync(configPath, "utf-8");
} catch (e) {
throw new Error(e.message);
}
}
return null;
};