async function isDirectory(filePath) {
	try {
		return (await stat(filePath)).isDirectory();
	} catch (error) {
		if (error.code === "ENOENT" || error.code === "ENOTDIR") {
			return false;
		}
		throw error;
	}
}
Check if a given file path is a directory or not.
@param {string} filePath The path to a file to check.
@returns {Promise<boolean>} `true` if the given path is a directory.