UNPKG

@modern-js/utils

Version:

A Progressive React Framework for modern web development.

11 lines (10 loc) 334 B
import "node:module"; import { fs } from "../compiled.mjs"; const findExists = (files)=>{ for (const file of files)if (fs.existsSync(file) && fs.statSync(file).isFile()) return file; return false; }; const emptyDir = async (dir)=>{ if (await fs.pathExists(dir)) await fs.emptyDir(dir); }; export { emptyDir, findExists };