Check if a filepath point to a directory. Returns false if the filepath does not exist or is a file.

await isDirectory(filepath)

Examples

if (await isDirectory('./dist')) {
  console.info('Directory exists');
}

Note

This follows symlinks, so if filepath is a link to a directory, it will return true. If filepath is a link to a file, it will return false.