community / src /core /readPostFile.mts
jbilcke-hf's picture
jbilcke-hf HF staff
initial commit
b2d7d99
raw
history blame contribute delete
256 Bytes
import { promises as fs } from "node:fs"
import { Post } from "../types.mts"
export const readPostFile = async (postFilePath: string): Promise<Post> => {
const post = JSON.parse(
await fs.readFile(postFilePath, 'utf8')
) as Post
return post
}