Files
blitzkit/src/core/blitz/readYAML.ts
T
2024-01-25 12:20:34 -06:00

8 lines
206 B
TypeScript

import { readFile } from 'fs/promises';
import { parse } from 'yaml';
export async function readYAML<Type>(file: string) {
const yaml = (await readFile(file)).toString();
return parse(yaml) as Type;
}