13 lines
353 B
TypeScript
13 lines
353 B
TypeScript
import { parse } from "jsr:@std/toml";
|
|
import path from "node:path";
|
|
const text = await Deno.readTextFile("config.toml");
|
|
const data = parse(text);
|
|
console.log(data);
|
|
|
|
export async function parse_config_file(
|
|
path: path.ParsedPath,
|
|
): Promise<Record<string, unknown>> {
|
|
const toml = await Deno.readTextFile(path.toString());
|
|
return parse(toml);
|
|
}
|