/** * Node.js-specific parser functions that use the fs module. * These functions are not available in browser environments. */ import * as fs from 'fs'; import { parseContent } from './parser.js'; import type { Block } from './block.js'; /** * Parse a .prf file from the filesystem and return a list of top-level blocks. * This function is only available in Node.js environments. */ export function parseFileSync(filepath: string): Block[] { const content = fs.readFileSync(filepath, 'utf-8'); return parseContent(content); } /** * Async version of parseFileSync. * This function is only available in Node.js environments. */ export async function parseFile(filepath: string): Promise { const content = fs.readFileSync(filepath, 'utf-8'); return parseContent(content); }