🌳
pt0/serverF/libFs/read1FileF.mts
1import type { absFileDirPath } from "../../ptDirF.mts"
5export const read1File = async (path: absFileDirPath): Promise<string> => {
6 try {
7 return await origFsPromises.readFile(path, 'utf-8')
8 } catch (err) {
9 const code = (err as NodeJS.ErrnoException)?.code, msg = err instanceof Error ? err.message : String(err)
10 throw new PtErr(`read1File: ${path} (${code}: ${msg})`)
11 }