isDirectory

It verifies if the path passed is a path to a existing directory in the file system. If valid, it resolves the dirPath.
Parameter ListReturnsRejection Errors
  • dirPath: string
  • tuple: Array (Optional)
Promise<string || Array>
Related FunctionsFunction Signature
function isDirectory(dirPath[, tuple]): Promise<string || Array>
1 2 3 import { isDirectory } from "puddy-m/lib/fileFunctions"; isDirectory("foo/bar").then((dirPath) => console.log(dirPath)); // if foo bar exists, it will print dirPath
1 2 3 4 5 import { isDirectory } from "puddy-m/lib/fileFunctions"; isDirectory("foo/bar", []) .then((tuple) => isDirectory("fizz/buzz", tuple)) .then(([dirPath1, dirPath2]) => console.log(dirPath1 + " - " + dirPath2)); // if foo/bar and fizz/buz exists, it will print "foo/bar - fizz/buzz"