ensureDirectory
S'assure qu'un dossier existe.
Exemple
ts
import { SF } from "@duplojs/server-utils";
import { E } from "@duplojs/utils";
const result = await SF.ensureDirectory("/tmp/project");
// result: E.Ok | SF.FileSystemLeft
if (E.isRight(result)) {
// directory create with success
}Syntaxe
typescript
function ensureDirectory(
path: string | URL
): Promise<FileSystemLeft | E.Ok>Paramètres
path: chemin du dossier a garantir.
Valeur de retour
E.Ok: si le dossier existe ou a ete crée.FileSystemLeft: si l'opération échoue.
Voir aussi
makeDirectory- Crée un dossier.
