util: fs: Add generic file read helper

This commit is contained in:
Danny Lin 2021-11-28 19:48:48 -08:00
parent 5ad4cad307
commit e307b06982

View file

@ -57,3 +57,7 @@ export async function withTempDir<Return>(callback: (tmp: TempState) => Promise<
await fs.rm(dir, { force: true, recursive: true }) await fs.rm(dir, { force: true, recursive: true })
} }
} }
export async function readFile(path: string) {
return await fs.readFile(path, { encoding: 'utf8' })
}