12 lines
302 B
TypeScript
12 lines
302 B
TypeScript
import { readFile } from "node:fs/promises";
|
|
|
|
// FIXME: Handle the error here
|
|
const loadFile = async (path: string): Promise<string> => {
|
|
// Specifying 'utf8' returns a string; otherwise, it returns a Buffer
|
|
const data = await readFile(path, "utf8");
|
|
|
|
return data;
|
|
};
|
|
|
|
export { loadFile };
|