Answers for "if directory exist in fs"

26

check directory exist node

const fs = require("fs"); // Or `import fs from "fs";` with ESM
if (fs.existsSync(path)) {
    // Do something
}
Posted by: Guest on May-22-2020
3

fs check if dir is dir

fs.lstatSync(path_string).isDirectory()
Posted by: Guest on June-05-2021

Code answers related to "if directory exist in fs"

Code answers related to "Javascript"

Browse Popular Code Answers by Language