UNPKG

postflame

Version:

🔥 Generate Postman collections automatically from Hono + Zod routes.

12 lines (11 loc) • 349 B
import fs from 'fs'; import path from 'path'; export function ensureDirExists(filePath) { const dir = path.dirname(filePath); if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true }); } export function writeJSON(filePath, data) { ensureDirExists(filePath); fs.writeFileSync(filePath, JSON.stringify(data, null, 2)); }