os path exists code example
Example 1: python os.path.isdir exception
import os
if os.path.isdir(root_folder):
print('Ok')
else:
print('Nok')
Example 2: node if path exists
const fs = require("fs"); // Or `import fs from "fs";` with ESM
if (fs.existsSync(path)) {
// Do something
}