UNPKG

delta-file-multer

Version:

A simple plug-n-play file upload middleware using Multer and MongoDB

9 lines (7 loc) 189 B
import fs from "fs"; import path from "path"; export const ensureDirExists = (dirPath) => { if (!fs.existsSync(dirPath)) { fs.mkdirSync(dirPath, { recursive: true }); } };