(filePath: string, content: string)
| 42 | } |
| 43 | |
| 44 | export async function writeTextSecure(filePath: string, content: string): Promise<void> { |
| 45 | await ensureDir(path.dirname(filePath)) |
| 46 | await fs.writeFile(filePath, content, { encoding: "utf8", mode: 0o600 }) |
| 47 | await fs.chmod(filePath, 0o600) |
| 48 | } |
| 49 | |
| 50 | export async function writeJson(filePath: string, data: unknown): Promise<void> { |
| 51 | const content = JSON.stringify(data, null, 2) |
no test coverage detected