@modern-js/utils
Version:
A Progressive React Framework for modern web development.
10 lines (9 loc) • 312 B
JavaScript
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 };