util: fs: Add generic file read helper
This commit is contained in:
parent
5ad4cad307
commit
e307b06982
1 changed files with 4 additions and 0 deletions
|
@ -57,3 +57,7 @@ export async function withTempDir<Return>(callback: (tmp: TempState) => Promise<
|
|||
await fs.rm(dir, { force: true, recursive: true })
|
||||
}
|
||||
}
|
||||
|
||||
export async function readFile(path: string) {
|
||||
return await fs.readFile(path, { encoding: 'utf8' })
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue