media-server / src /getDatabase.mts
jbilcke-hf's picture
jbilcke-hf HF staff
add a system to recover from broken generation cycles
f7f7c46
raw
history blame contribute delete
257 Bytes
import { promises as fs } from 'node:fs'
import { Database } from './types.mts'
export const getDatabase = async (filePath: string): Promise<Database> => {
const rawFile = await fs.readFile(filePath, 'utf8')
return JSON.parse(rawFile) as Database
}