2023-11-13 15:33:56 -05:00
|
|
|
import { IFIO } from '../common/types.ts';
|
|
|
|
|
|
|
|
import { readFileSync } from 'node:fs';
|
|
|
|
|
|
|
|
const BunFileIO: IFIO = {
|
|
|
|
openFile: async (path: string): Promise<string> => {
|
|
|
|
const file = await Bun.file(path);
|
|
|
|
return await file.text();
|
|
|
|
},
|
|
|
|
openFileSync: (path: string): string => {
|
2023-11-14 15:53:45 -05:00
|
|
|
return readFileSync(path).toString();
|
2023-11-13 15:33:56 -05:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BunFileIO;
|