arredemo
Version:
Instantly build a static site for your package
15 lines (13 loc) • 299 B
JavaScript
import { statSync } from "node:fs"
/**
* Checks if the given path exists and is a directory synchronously.
* @param {string} path - The path to check.
* @returns {boolean}
*/
export function isDirectory(path) {
try {
return statSync(path).isDirectory()
} catch {
return false
}
}