ruins
Version:
> [!IMPORTANT] > This is in beta. Not everything is ironed out and some modules might misbehave
17 lines (14 loc) • 520 B
text/typescript
import { loadConfig } from "c12";
import { getConfig } from "./getConfig.js";
import type { RuinsOutput, RuinsTodos } from "../types/ruins.js";
import { resolve } from "node:path";
export const getTodos = async () => {
const settings = await getConfig();
// TODO: fix this path stuff
const cwdFromNpm = process.cwd().replace(/\/api/, "");
const { config } = await loadConfig<RuinsOutput<RuinsTodos>>({
cwd: resolve(cwdFromNpm, settings.dir),
configFile: settings.files.todos,
});
return config;
};