formatter.ts 252 B

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