import{ ensureDir, path }from'./std.ts' exportasyncfunctionexistsDir(path:string){try{const fi =awaitDeno.lstat(path)if(fi.isDirectory){returntrue}returnfalse}catch(err){if(err instanceofDeno.errors.NotFound){returnfalse}throw err}} exportfunctionexistsDirSync(path:string){try{const fi =Deno.lstatSync(path)if(fi.isDirectory){returntrue}returnfalse}catch(err){if(err instanceofDeno.errors.NotFound){returnfalse}throw err}} exportasyncfunctionexistsFile(path:string){try{const fi =awaitDeno.lstat(path)if(fi.isFile){returntrue}returnfalse}catch(err){if(err instanceofDeno.errors.NotFound){returnfalse}throw err}} exportfunctionexistsFileSync(path:string){try{const fi =Deno.lstatSync(path)if(fi.isFile){returntrue}returnfalse}catch(err){if(err instanceofDeno.errors.NotFound){returnfalse}throw err}} /** ensure and write a text file */exportasyncfunctionensureTextFile(name:string, content:string){const dir = path.dirname(name)awaitensureDir(dir)awaitDeno.writeTextFile(name, content)}