fs.lstatSync(path_string).isDirectory()
import fs from 'fs' if (fs.existsSync(path)) { // Do something }