check directory exist node

Code Example - check directory exist node

                
                        const fs = require("fs"); // Or `import fs from "fs";` with ESM
if (fs.existsSync(path)) {
    // Do something
}
                    
                
 

Check Directory Exist

                        
                                //check directory exist
string directoryExistPath = @"C:\Users\Yogeshkumar Hadiya\Desktop\DirectoryHandling";
if (Directory.Exists(directoryExistPath))
{
    Console.WriteLine("Directory exist");
}
else
{
    Console.WriteLine("Directory not exist");
}
                            
                        
 

Related code examples