(file, ...args)
| 7 | import { dirname } from 'node:path'; |
| 8 | |
| 9 | export function outputFileSync(file, ...args) { |
| 10 | const dir = dirname(file); |
| 11 | if (!existsSync(dir)) { |
| 12 | mkdirSync(dir, { recursive: true }); |
| 13 | } |
| 14 | |
| 15 | writeFileSync(file, ...args); |
| 16 | } |
| 17 | |
| 18 | export function readJSONSync(file, options = {}) { |
| 19 | if (typeof options === 'string') { |