You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
425 B
TypeScript
15 lines
425 B
TypeScript
1 year ago
|
import { promises as fs } from 'node:fs'
|
||
|
import { buildUtilsLog } from './'
|
||
|
|
||
|
const stage = 'File'
|
||
|
|
||
|
export async function buildUtilsReadFile(path: string) {
|
||
|
buildUtilsLog(`Reading File: ${path}`, stage)
|
||
|
return await fs.readFile(path, 'utf8')
|
||
|
}
|
||
|
|
||
|
export async function buildUtilsWriteFile(path: string, data: any) {
|
||
|
buildUtilsLog(`Writing data into File: ${path}`, stage)
|
||
|
return await fs.writeFile(path, data, 'utf8')
|
||
|
}
|