ai-tube-clap-exporter / src /core /files /readPlainText.mts
jbilcke-hf's picture
jbilcke-hf HF staff
initial commit 🎬
2cae2a9
raw
history blame
336 Bytes
import { promises as fs } from "fs"
export async function readPlainText(filePath: string): Promise<string> {
try {
const plainText = await fs.readFile(filePath, "utf-8");
return plainText;
} catch (error) {
// Handle errors (e.g., file not found, no permissions, etc.)
console.error(error);
throw error;
}
}