zhangwencui
2026-07-10 1c1f20aa356e90b59964dda3c0d7d1eb7f7e950f
1
2
3
4
5
6
7
8
9
10
11
12
13
import fs from 'node:fs/promises';
 
import { execa } from 'execa';
 
async function formatFile(filepath: string) {
  await execa('oxfmt', [filepath], {
    stdio: 'inherit',
  });
 
  return await fs.readFile(filepath, 'utf8');
}
 
export { formatFile };