File size: 257 Bytes
f7f7c46
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
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
}