UNPKG

@techmely/utils

Version:

Collection of helpful JavaScript / TypeScript utils

23 lines (19 loc) 428 B
/*! * @techmely/utils * Copyright(c) 2021-2024 Techmely <techmely.creation@gmail.com> * MIT Licensed */ import "./chunk-NYLAFCGV.mjs"; // src/writeFile.ts import fs from "fs"; import path from "path"; function writeFile(filename, content) { const dir = path.dirname(filename); if (!fs.existsSync(dir)) { fs.mkdirSync(dir, { recursive: true }); } fs.writeFileSync(filename, content); } export { writeFile };