Files

12 lines
301 B
TypeScript
Raw Permalink Normal View History

2025-02-10 14:13:52 +01:00
import fs from 'fs/promises';
import path from 'path';
/**
* Reads the file contents.
*
* @param {string} path
* @returns {string} The contents of a file
*/
export const readFile = (filePath: string): Promise<string | Buffer> =>
fs.readFile(path.resolve(__dirname, '../', filePath), 'utf-8');