ytdlp_video_processor
Version:
A configurable yt-dlp wrapper to download YouTube videos
14 lines (11 loc) • 372 B
JavaScript
const fs = require("fs")
/**
* Ensures that the specified directory exists. If it doesn't, it's created.
* @param {string} dirPath - The path of the directory to check and create if necessary.
*/
function ensureDirectoryExists(dirPath) {
if (!fs.existsSync(dirPath)) {
fs.mkdirSync(dirPath, { recursive: true })
}
}
module.exports = { ensureDirectoryExists }