UNPKG

@servable/parse-server-engine

Version:
15 lines (12 loc) 329 B
import fs from 'fs' import path from 'path' import checkFileExists from './checkFileExists.js' const operation = async filePath => { var dirname = path.dirname(filePath) if (!(await checkFileExists(dirname))) { return true } ensureDirectoryExistence(dirname) fs.promises.mkdir(dirname) } export default operation