UNPKG

specpress

Version:

Export PDF and/or DOCX files from a subset of Markdown, ASN.1 and JSON files

13 lines (11 loc) 384 B
import { mkdir } from "fs/promises"; import { normalize } from "path"; export async function ensureDirectoryExists(pathFiile) { const normalizedPath = normalize(pathFiile); try { // Create the directory if it does not exist await mkdir(normalizedPath, { recursive: true }); } catch (error) { console.error(`Error creating the directory: ${error.message}`); } }