feat(directory): add directory.json for index page

This commit is contained in:
Haoyu Xu
2023-01-16 18:27:48 -05:00
parent 2f53443064
commit e58659d8fc
6 changed files with 61 additions and 4 deletions

View File

@@ -6,6 +6,11 @@ export async function write(content, filePath) {
return await fsP.writeFile(filePath, content, { flag: 'w' })
}
export function writeSync(content, filePath) {
mkdir(path.dirname(filePath))
return fs.writeFileSync(filePath, content, { flag: 'w' })
}
export async function read(filePath, encoding = 'utf8') {
return await fsP.readFile(filePath, encoding, { flag: 'r' })
}